Re: [HACKERS] patternsel() and histogram_selectivity() and the hard cutoff of 100

2008-02-12 Thread Matteo Beccati

Hi Greg,


So I had a thought about how to soften the controversial hard cutoff of 100
for the use of the histogram selectivity. Instead of switching 100% one way or
the other between the two heuristics why not calculate both and combine them.
The larger the sample size from the histogram the more we can weight the
histogram calculation. The smaller the histogram size the more we weight the
heuristic.

My first thought was to scale it linearly so we use 10% of the histogram
sample + 90% of the heuristic for default statistic sizes of 10 samples. That
degenerates to the status quo for 100 samples and up.


Incidentally I hacked up a patch to do this:


Sounds sensible to me, at least much more than a hardcoded magic number 
a few people know about...



Cheers

--
Matteo Beccati

Openads - http://www.openads.org

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] Patch review

2008-02-12 Thread Bruce Momjian
Magnus Hagander wrote:
 It would also be better to be able to off-load it to more than one 
 person. For example, I would like to be able to get into the unapplied 
 patches list and remove the email about events on 8.3RC1. First of all, 
 it's not a patch, but it's listed under it. But more importantly, it has 
 been fixed and should just be removed. So I now have to email you to ask 
 you to remove it, and then you have to do the actual work, which means 
 double work.

True.  Those web pages are emails pulled from the stream of emails that
I think are worthy of discussion during 8.4 development.

If we assume we want to continue communicating via email I need a way to
pull items out and collect them, and unfortunately right now it is hard
for others to help in that.

I have a few ideas.  First I could easily create an email address that
would allow others to _add_ emails to the web page (via bounce) but that
doesn't solve the issue of allowing people to comment on and delete
items.  

Do most email readers support bouncing emails to another address, so the
to/from fields are not modified?  (Seems there is a Thunderbird
extension to do it,
http://blog.mecworks.com/articles/2005/04/20/bouncing-mail-in-thunderbird/.)

There is no reason I have to host the list here.  I can _bounce_ emails
to any address.  Is there a service we can use that allows emails to be
accepted and displayed on a web site and that allows deletions and
comments, and has stable URLs for every email message?  Is there
software I can install on my server to do this?

If we want to communicate via a web interface, I would still need a way
to collect specific messages (not always entire threads).

-- 
  Bruce Momjian  [EMAIL PROTECTED]http://momjian.us
  EnterpriseDB http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] Patch review

2008-02-12 Thread Bruce Momjian
Bruce Momjian wrote:
 Bruce Momjian wrote:
  Bruce Momjian wrote:
   Tom Lane wrote:
Bruce Momjian [EMAIL PROTECTED] writes:
 I have added message-id's to both patches web sites.  The message id
 appears next to the author in the thread listing, and at the top of 
 the
 message page.

That's an improvement, but it doesn't solve the other fundamental
problem, which is the lack of any way to annotate the list.
   
   Agreed, and it doesn't allow people to delete items either.  Hold, I
   think I can add annotations if that's what people want; you can see an
   example in my blog:
   
 http://momjian.us/main/blogs/blog.html
  
  OK, comments added, and they are based on message-id, so they will not
  change over time.  
  
  I am using JS-Kit, http://js-kit.com/comments/, article
  http://blog.wired.com/monkeybites/2006/11/jskit_add_comme.html.
 
 Seems the comments slowed down the page load so I now have the thread
 broken down into 50 emails per page.

I got a message from someone saying I was trying too hard to avoid using
a tracker.

I think I was clear what functionality I needed and no one had any
ready-made solutions.  Let me give a practical example of what I need.

Suppose we were using a web-based discussion forum, rather than email. 
Assume it is something like Slashdot, where you have article titles and
comments.

For the patches lists I need to take sometimes entire threads, sometimes
groups of comments, and store them in a format so people can review them
as a digest.  And I want to allow comments on these items, and ideally
allow multiple people to delete them.

If I link to a comment URL, how do people know if they should look at
that comment or all comments below it?  

If I had omment URLs, how would I present those in a threaded way?  A
flat list of URL would be too crude and lack titles.   So, ultimately I
would need a threaded way to present the URLs, which is pretty much what
mhonarc does now.  Comments would certainly be easier because you could
just add comments to the discussion threads.  Deleting URLs would be the
same as mhonarc, except the URLs would be static.

So, if we did have a tracker, how would it be different?  Comments would
be more integrated but I am unclear how the patches_hold queue would be
different.

Basically what I do now is to take the email stream and chop pieces out
of it for later review.  I see a tracker making some of that process
easier and more distributed/shared, but some of it harder and more
complex.

-- 
  Bruce Momjian  [EMAIL PROTECTED]http://momjian.us
  EnterpriseDB http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] Patch review

2008-02-12 Thread Bruce Momjian
Brendan Jurd wrote:
 On Feb 13, 2008 10:45 AM, Bruce Momjian [EMAIL PROTECTED] wrote:
  For the patches lists I need to take sometimes entire threads, sometimes
  groups of comments, and store them in a format so people can review them
  as a digest.  And I want to allow comments on these items, and ideally
  allow multiple people to delete them.
 
 
 Hi Bruce,
 
 If we were using a tracker, why would you need to produce this
 digest at all?  Why would you not simply refer people to, e.g., the
 tracker's report of all outstanding tickets in 8.4?

Uh, well, it is kind of hard because it assumes discussions are linear,
meaning an item has only one ticket, and the ticket is clear on what to
do.  In practice, that is not usually the case.

-- 
  Bruce Momjian  [EMAIL PROTECTED]http://momjian.us
  EnterpriseDB http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [HACKERS] Patch review

2008-02-12 Thread Brendan Jurd
On Feb 13, 2008 10:45 AM, Bruce Momjian [EMAIL PROTECTED] wrote:
 For the patches lists I need to take sometimes entire threads, sometimes
 groups of comments, and store them in a format so people can review them
 as a digest.  And I want to allow comments on these items, and ideally
 allow multiple people to delete them.


Hi Bruce,

If we were using a tracker, why would you need to produce this
digest at all?  Why would you not simply refer people to, e.g., the
tracker's report of all outstanding tickets in 8.4?

Regards,
BJ

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] Patch review

2008-02-12 Thread Bruce Momjian
Gregory Stark wrote:
 Bruce Momjian [EMAIL PROTECTED] writes:
 
  Suppose we were using a web-based discussion forum, rather than email. 
 
 That would be crazy, why would I suppose such a thing?
 
  For the patches lists I need to take sometimes entire threads, sometimes
  groups of comments, and store them in a format so people can review them
  as a digest.  
 
 Why do you need to do any such thing? What does any of that have to do with a
 patches queue?

TODO items and patches are often in the middle of threads.

  If I link to a comment URL, how do people know if they should look at
  that comment or all comments below it?  
 
 They should look at whatever they want to. I usually have to back up several
 messages to understand the context and then follow several messages later. You
 can't possibly know how much context people will need to understand. You can't
 try to control people to that level of detail.
 
  If I had omment URLs, how would I present those in a threaded way?  
 
  So, if we did have a tracker, how would it be different?  Comments would
  be more integrated but I am unclear how the patches_hold queue would be
  different.
 
 A patches queue is just a list of patches with their current status. Not a
 replacement for our mailing lists. You're trying to solve the wrong problem.
 
 The current status for a patch is just something like waiting for feedback on
 questions from message [link] or waiting for new version addressing issues
 raised in review [link]. That's it.
 
 The critical information we need are: What's the most recent version of the
 patch? what is it blocking on? and who is it blocking on? 

The discussion was mostly related to the 8.3 patches_hold queue where
people wanted help processing it.

-- 
  Bruce Momjian  [EMAIL PROTECTED]http://momjian.us
  EnterpriseDB http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] Patch review

2008-02-12 Thread Gregory Stark
Bruce Momjian [EMAIL PROTECTED] writes:

 Suppose we were using a web-based discussion forum, rather than email. 

That would be crazy, why would I suppose such a thing?

 For the patches lists I need to take sometimes entire threads, sometimes
 groups of comments, and store them in a format so people can review them
 as a digest.  

Why do you need to do any such thing? What does any of that have to do with a
patches queue?

 If I link to a comment URL, how do people know if they should look at
 that comment or all comments below it?  

They should look at whatever they want to. I usually have to back up several
messages to understand the context and then follow several messages later. You
can't possibly know how much context people will need to understand. You can't
try to control people to that level of detail.

 If I had omment URLs, how would I present those in a threaded way?  

 So, if we did have a tracker, how would it be different?  Comments would
 be more integrated but I am unclear how the patches_hold queue would be
 different.

A patches queue is just a list of patches with their current status. Not a
replacement for our mailing lists. You're trying to solve the wrong problem.

The current status for a patch is just something like waiting for feedback on
questions from message [link] or waiting for new version addressing issues
raised in review [link]. That's it.

The critical information we need are: What's the most recent version of the
patch? what is it blocking on? and who is it blocking on? 

-- 
  Gregory Stark
  EnterpriseDB  http://www.enterprisedb.com
  Ask me about EnterpriseDB's Slony Replication support!

---(end of broadcast)---
TIP 6: explain analyze is your friend


[HACKERS] REL8_3_STABLE branch created ...

2008-02-12 Thread Marc G. Fournier
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Just set down the branch so that movement can happen towards 8.4.0 ... let me 
know if there are any problems ...

- 
Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email . [EMAIL PROTECTED]  MSN . [EMAIL PROTECTED]
Yahoo . yscrappy   Skype: hub.orgICQ . 7615664
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQFHsmG24QvfyHIvDvMRAuxJAKCy9OuplihNOTivwd08va7rAJxKMwCeLl1Z
0n8apgMIsvXC6d6Q8oJVE2o=
=Bi3l
-END PGP SIGNATURE-


---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


[HACKERS] Locale vs LIKE

2008-02-12 Thread Stephen Denne
Given the improvements in 8.3 listed in the release notes:
- Improve efficiency of LIKE/ILIKE, especially for multi-byte character sets 
like UTF-8 (Andrew, Itagaki Takahiro)

Does this still hold:
http://www.postgresql.org/docs/8.3/interactive/locale.html

The drawback of using locales other than C or POSIX in PostgreSQL is its 
performance impact. It slows character handling and prevents ordinary indexes 
from being used by LIKE. For this reason use locales only if you actually need 
them.

i.e. Do I still have to either initdb --locale=C or explicitly use 
text_pattern_ops?

(Queries include predicates of the form [indexed text expression] like ABC%)

Stephen Denne

Disclaimer:
At the Datamail Group we value team commitment, respect, achievement, customer 
focus, and courage. This email with any attachments is confidential and may be 
subject to legal privilege.  If it is not intended for you please advise by 
reply immediately, destroy it and do not copy, disclose or use it in any way.

__
  This email has been scanned by the DMZGlobal Business Quality 
  Electronic Messaging Suite.
Please see http://www.dmzglobal.com/services/bqem.htm for details.
__


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[HACKERS] Branched for 8.4

2008-02-12 Thread Bruce Momjian
We have branced CVS for 8.4.  The 8.3 CVS tag is REL8_3_STABLE.

I have started tracking our development status at the top of my 
Postgres blog page.

-- 
  Bruce Momjian  [EMAIL PROTECTED]http://momjian.us
  EnterpriseDB http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


Re: [HACKERS] Patch review

2008-02-12 Thread Gregory Stark
Bruce Momjian [EMAIL PROTECTED] writes:

 Gregory Stark wrote:
 Bruce Momjian [EMAIL PROTECTED] writes:
 
  For the patches lists I need to take sometimes entire threads, sometimes
  groups of comments, and store them in a format so people can review them
  as a digest.  
 
 Why do you need to do any such thing? What does any of that have to do with a
 patches queue?

 TODO items and patches are often in the middle of threads.

No, messages which propose the items and patches are in the middle of the
thread. What we need is a list of the actual items. We already have an archive
of the messages.

Looking at your held queue, how many patches are in there? Who are the
authors? Which ones are waiting for feedback before they can continue?

 The critical information we need are: What's the most recent version of the
 patch? what is it blocking on? and who is it blocking on? 

 The discussion was mostly related to the 8.3 patches_hold queue where
 people wanted help processing it.

Yes, the information I listed is the what we need to do that.

-- 
  Gregory Stark
  EnterpriseDB  http://www.enterprisedb.com
  Ask me about EnterpriseDB's PostGIS support!

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Hiroshi Saito

Hi Alvaro-san.

Yes, However, It is not in good condition at the reason a message catalog still is not enough. 
Then, I have tried these adjustments with the problem of a locale. Still, it is not much time. 
But, My condition is not good so that I'm may  be influenza. :-(


Regards,
Hiroshi Saito

- Original Message - 
From: Alvaro Herrera [EMAIL PROTECTED]




Hiroshi Saito wrote:

Hi

--Document.--
Table 9-22.
TM prefix translation mode (print localized day and month names based on 
lc_messages)
--
http://winpg.jp/~saito/pg_work/NLS_TO_CHAR_JP.png
But, Although Japanese is out of condition

Does the fundamental specification change?


Humm, I cannot read Japanese so as far as I can make, this is working fine?

--
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

   http://www.postgresql.org/about/donate


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Hiroshi Saito

From: Alvaro Herrera [EMAIL PROTECTED]


Dave Page wrote:

On Feb 12, 2008 4:44 PM, Alvaro Herrera [EMAIL PROTECTED] wrote:
 What this really means is that locale support is completely broken in
 the MSVC build, i.e. you cannot get localized strings at all (not just
 to_char()).  Is this correct?  If so, this is a serious problem.

Not judging by Hiroshi's screenshot. I don't speak Japanese either,
but it certainly didn't say 'tuesday' after he adjusted LC_MESSAGES.


But it has the string mingw in the path, so I suspect it's not MSVC ...
Hiroshi-san, can you confirm?


Yeah, However, I go to a hospital from now sorry.
I will check it, after returning. 


Regards,
Hiroshi Saito

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] REL8_3_STABLE branch created ...

2008-02-12 Thread Tom Lane
Marc G. Fournier [EMAIL PROTECTED] writes:
 Just set down the branch so that movement can happen towards 8.4.0 ... let me
 know if there are any problems ...

Looks good from here --- I stamped HEAD as 8.4devel.

Let the games begin!

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Gevik Babakhani
 What this really means is that locale support is completely 
 broken in the MSVC build, i.e. you cannot get localized 
 strings at all (not just to_char()).  Is this correct?  If 
 so, this is a serious problem.
 

The way one could confirm this is by:

1. rename share/locale/de to share/locale/German_Germany
2. start a dosbox
3. before starting PG, set an env variable SET LANGUAGE=German_Germany in
that dosbox, which will force all child threads to have that locale.
3. start PG form that dosbox and SET LC_MESSAGES to es_ES or
Spanish_Spain or es_ES.utf8 or anything else...; select
to_char(now(),'TMDay TMMonth ');
4. The result will be in German and not Spanish as one expects.


If handling locale in to_char will remain using gettext then I can start
working on a patch to fix this.

Regards,
Gevik Babakhani

PostgreSQL NL   http://www.postgresql.nl
TrueSoftware BV http://www.truesoftware.nl



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] Patch review

2008-02-12 Thread Bruce Momjian
Bruce Momjian wrote:
 Bruce Momjian wrote:
  Tom Lane wrote:
   Bruce Momjian [EMAIL PROTECTED] writes:
I have added message-id's to both patches web sites.  The message id
appears next to the author in the thread listing, and at the top of the
message page.
   
   That's an improvement, but it doesn't solve the other fundamental
   problem, which is the lack of any way to annotate the list.
  
  Agreed, and it doesn't allow people to delete items either.  Hold, I
  think I can add annotations if that's what people want; you can see an
  example in my blog:
  
  http://momjian.us/main/blogs/blog.html
 
 OK, comments added, and they are based on message-id, so they will not
 change over time.  
 
 I am using JS-Kit, http://js-kit.com/comments/, article
 http://blog.wired.com/monkeybites/2006/11/jskit_add_comme.html.

Seems the comments slowed down the page load so I now have the thread
broken down into 50 emails per page.

-- 
  Bruce Momjian  [EMAIL PROTECTED]http://momjian.us
  EnterpriseDB http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


Re: [HACKERS] Patch review

2008-02-12 Thread Bruce Momjian
Bruce Momjian wrote:
 Tom Lane wrote:
  Bruce Momjian [EMAIL PROTECTED] writes:
   I have added message-id's to both patches web sites.  The message id
   appears next to the author in the thread listing, and at the top of the
   message page.
  
  That's an improvement, but it doesn't solve the other fundamental
  problem, which is the lack of any way to annotate the list.
 
 Agreed, and it doesn't allow people to delete items either.  Hold, I
 think I can add annotations if that's what people want; you can see an
 example in my blog:
 
   http://momjian.us/main/blogs/blog.html

OK, comments added, and they are based on message-id, so they will not
change over time.  

I am using JS-Kit, http://js-kit.com/comments/, article
http://blog.wired.com/monkeybites/2006/11/jskit_add_comme.html.

-- 
  Bruce Momjian  [EMAIL PROTECTED]http://momjian.us
  EnterpriseDB http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Magnus Hagander

Alvaro Herrera wrote:

Gevik Babakhani wrote:


4. Locale names are different in MS Windows. I created a C app to test
gettext on Windows. 
setting LC_MESSAGES to Spanisg_Spain and German_Germany works but es_ES and

de_DE do not :(

SET LC_MESSAGES to '' has no effect because:

A. gettext compiled/linked in MSVC looks for the locale of the current
thread and NOT the LC_MESSAGES,LANGIAGE,LANG... environment variables. See
gettext's sources

B. Given current thread's locale Spanish_Spain, gettext fails to find a
directory called Spanish_Spain in share/locale. As result English names
are returned.


What this really means is that locale support is completely broken in
the MSVC build, i.e. you cannot get localized strings at all (not just
to_char()).  Is this correct?  If so, this is a serious problem.


I've certainly managed to get output in Swedish more than once... 
Annoying as hell because it's the default if you build with NLS and has 
your English language Windows configured with Swedish time/date format :)


//Magnus

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


Re: [HACKERS] Patch review

2008-02-12 Thread Bruce Momjian
Tom Lane wrote:
 Bruce Momjian [EMAIL PROTECTED] writes:
  I have added message-id's to both patches web sites.  The message id
  appears next to the author in the thread listing, and at the top of the
  message page.
 
 That's an improvement, but it doesn't solve the other fundamental
 problem, which is the lack of any way to annotate the list.

Agreed, and it doesn't allow people to delete items either.  Hold, I
think I can add annotations if that's what people want; you can see an
example in my blog:

http://momjian.us/main/blogs/blog.html

-- 
  Bruce Momjian  [EMAIL PROTECTED]http://momjian.us
  EnterpriseDB http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Patch review

2008-02-12 Thread Andrew Dunstan



Joshua D. Drake wrote:

What the heck is a steam hammer? :P



http://en.wikipedia.org/wiki/Steam_hammer


  


The same people went on to invent the steam television ...

cheers

andrew

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] Patch review

2008-02-12 Thread Bruce Momjian
Stefan Kaltenbrunner wrote:
 Stefan Kaltenbrunner wrote:
  Tom Lane wrote:
 [...]
  Personally I'd be happier with an editable wiki page consisting of links
  to the original messages in the mail list archives, plus free-format
  annotations (such as status).  This should be trivial to set up and
  reasonably flexible.  With experience we might find we need something
  fancier, but let's not overdesign our solution at the start.
  
  I will see if I can come up with a proposal on the developer wiki for a 
  list that looks like that tomorrow.
 
 I have simply converted the old 8.3 patch status page for now by 
 removing all the applied and rejected patches:
 
 http://developer.postgresql.org/index.php/Todo:PatchStatus
 
 I'm slowly adding some more stuff from the patches_hold list there but 
 given the way that list is structured this is a fairly difficult and 
 tendious task(a lot there is only discussion/design sketches and in 
 effect one has to check every single mail in there to see if should be 
 added) :-(

I have added message-id's to both patches web sites.  The message id
appears next to the author in the thread listing, and at the top of the
message page.

Unfortunately you can't search by message id in our archives, but if
that is fixed, I can add HTML to get that to work too.

I was hoping someone had a completed solution, but I guess not.

-- 
  Bruce Momjian  [EMAIL PROTECTED]http://momjian.us
  EnterpriseDB http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] Patch review

2008-02-12 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Mon, 11 Feb 2008 17:09:45 -0600
Decibel! [EMAIL PROTECTED] wrote:

 On Feb 9, 2008, at 1:08 AM, Tom Lane wrote:
  Let's not swat flies with steam hammers.
 
 
 What the heck is a steam hammer? :P

http://en.wikipedia.org/wiki/Steam_hammer

Joshua D. Drake

- -- 
The PostgreSQL Company since 1997: http://www.commandprompt.com/ 
PostgreSQL Community Conference: http://www.postgresqlconference.org/
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL SPI Liaison | SPI Director |  PostgreSQL political pundit

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHsdBfATb/zqfZUUQRAnkwAKCo5TaaIOWHVYFWCW/i5s0mHd5vDQCfUw1P
0sh/PuDHAbvQQITVuQbeT3s=
=EUBM
-END PGP SIGNATURE-

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


Re: [HACKERS] Patch review

2008-02-12 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes:
 I have added message-id's to both patches web sites.  The message id
 appears next to the author in the thread listing, and at the top of the
 message page.

That's an improvement, but it doesn't solve the other fundamental
problem, which is the lack of any way to annotate the list.

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Dave Page
On Feb 12, 2008 4:44 PM, Alvaro Herrera [EMAIL PROTECTED] wrote:
 What this really means is that locale support is completely broken in
 the MSVC build, i.e. you cannot get localized strings at all (not just
 to_char()).  Is this correct?  If so, this is a serious problem.

Not judging by Hiroshi's screenshot. I don't speak Japanese either,
but it certainly didn't say 'tuesday' after he adjusted LC_MESSAGES.

-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Oracle-compatible database company

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Alvaro Herrera
Gevik Babakhani wrote:

 4. Locale names are different in MS Windows. I created a C app to test
 gettext on Windows. 
 setting LC_MESSAGES to Spanisg_Spain and German_Germany works but es_ES and
 de_DE do not :(
 
 SET LC_MESSAGES to '' has no effect because:
 
 A. gettext compiled/linked in MSVC looks for the locale of the current
 thread and NOT the LC_MESSAGES,LANGIAGE,LANG... environment variables. See
 gettext's sources
 
 B. Given current thread's locale Spanish_Spain, gettext fails to find a
 directory called Spanish_Spain in share/locale. As result English names
 are returned.

What this really means is that locale support is completely broken in
the MSVC build, i.e. you cannot get localized strings at all (not just
to_char()).  Is this correct?  If so, this is a serious problem.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes:
 On Nov 24 2006 this was committed dor src/backend/utils/adt/formatting.c:

 r 1.114: Fix to_char() locale handling to honor LC_TIME, not LC_MESSAGES.

 A few hours later it was supposedly reverted: r 1.115: Revert (too late 
 in beta): Fix to_char() locale handling to honor LC_TIME, not LC_MESSAGES.

 Apparently this was never returned to (it should probably have been put 
 on the patches hold queue).

to_char's month/day name localization is implemented with gettext() not
strftime(), which is why it depends on LC_MESSAGES not LC_TIME.  I seem
to recall that we didn't like the side-effects of the patch you are
mentioning, and so it ended up being rejected outright.

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Bruce Momjian
Andrew Dunstan wrote:
 
 
 Alvaro Herrera wrote:
  Gevik Babakhani wrote:

  I have compiled 8.3 (CVS HEAD) with NLS on a XP box. But it seems that NLS
  support is broke.
  Could someone please confirm this.
  
 
  What I can confirm is that lc_messages is supposed to work for to_char,
  because it shows the localized output for me as I change lc_messages;
  and it doesn't if I change lc_time.
 

 
 FSVO supposed to.
 
 The CVS history is somewhat murky.
 
 On Nov 24 2006 this was committed dor src/backend/utils/adt/formatting.c:
 
 r 1.114: Fix to_char() locale handling to honor LC_TIME, not LC_MESSAGES.
 
 A few hours later it was supposedly reverted: r 1.115: Revert (too late 
 in beta): Fix to_char() locale handling to honor LC_TIME, not LC_MESSAGES.
 
 Apparently this was never returned to (it should probably have been put 
 on the patches hold queue).

Added to TODO list:

o Use LC_TIME for localized weekday/month names, rather than
  LC_MESSAGES

-- 
  Bruce Momjian  [EMAIL PROTECTED]http://momjian.us
  EnterpriseDB http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Hiroshi Saito

Hi

--Document.--
Table 9-22.
TM prefix translation mode (print localized day and month names based on 
lc_messages)
--
http://winpg.jp/~saito/pg_work/NLS_TO_CHAR_JP.png
But, Although Japanese is out of condition

Does the fundamental specification change?

Regards,
Hiroshi Saito

- Original Message - 
From: Alvaro Herrera [EMAIL PROTECTED]




Gevik Babakhani wrote:

I have compiled 8.3 (CVS HEAD) with NLS on a XP box. But it seems that NLS
support is broke.
Could someone please confirm this.


What I can confirm is that lc_messages is supposed to work for to_char,
because it shows the localized output for me as I change lc_messages;
and it doesn't if I change lc_time.

In any case,


Gevik=# show lc_messages ;
lc_messages

 English_United States.1252
(1 row)

Gevik=#
Gevik=# set lc_messages TO 'de_DE.utf8';
SET


I wonder if this is really valid.  Shouldn't you be using a locale name
like 'German_Germany.65001' or some such?  I thought Windows did not
recognize the de_DE.utf8 form of names.  Perhaps it failed to raise an
error here?  It does for me:

alvherre=# set lc_time to 'fr_CA.utf8';
SET
alvherre=# set lc_time to 'de_DE.utf8';
ERROR:  valor no válido para el parámetro «lc_time»: «de_DE.utf8»

Suffice to say I don't have the de_DE locale installed.

--
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly 



---(end of broadcast)---
TIP 6: explain analyze is your friend


[HACKERS] postmaster in a tight loop

2008-02-12 Thread Dan Langille

Folks,

I encountered a situation on Sunday night where the postmaster was in  
a tight
loop.  That's the conclusion we reached, but have no real proof.  I  
also have no
idea how to reproduce this situation.  This post is just an FYI in  
case it helps.


The laptop was running hot so I looked around and found pgsql to be  
the cause.

I decided to shutdown the postmaster, but it would not shutdown:

# /usr/local/etc/rc.d/postgresql stop
pg_ctl: server does not shut down

After that, I started looking closer.

For starters, here is what the system looked like:

$ date
Sun Feb 10 19:38:10 EST 2008


$ ps auwx | grep pgsql
pgsql   1172 90.0  0.4 44636  3088  ??  Rs   10:45AM  21:55.16 / 
usr/local/bin/postgres -D /usr/local/pgsql/data
pgsql   1183  0.0  0.4 44652  3392  ??  Ss   10:45AM   0:06.77  
postgres: writer process(postgres)
pgsql   1184  0.0  0.4 44652  3176  ??  Ss   10:45AM   0:04.42  
postgres: wal writer process(postgres)
pgsql   1185  0.0  0.4 44884  3336  ??  Ss   10:45AM   0:03.35  
postgres: autovacuum launcher process(postgres)
pgsql   1186  0.0  0.4  8588  3060  ??  Ss   10:45AM   0:03.77  
postgres: stats collector process(postgres)


A little bit from top:

last pid: 89359;  load averages:  3.10,  2.84,   
2.30   
up 0+08:53:20  19:37:54

84 processes:  5 running, 79 sleeping
CPU states: 48.3% user,  0.8% nice, 50.8% system,  0.0% interrupt,   
0.0% idle

Mem: 306M Active, 235M Inact, 104M Wired, 27M Cache, 85M Buf, 68M Free
Swap: 512M Total, 512M Free

  PID USERNAMETHR PRI NICE   SIZERES STATETIME   WCPU  
COMMAND
 1172 pgsql 1 1300 44636K  3088K RUN 22:18 77.34%  
postgres

 1387 root  1 1000 85936K 62032K RUN 10:48  4.49% Xorg
89357 dan   1   80  1860K  1424K wait 0:00  1.00% sh
46507 dan   1  960 15636K  9900K select   1:52  0.05%  
npviewer.bin
88563 dan   1  960 28856K 21128K RUN  0:01  0.05%  
kdeinit


$ uname -a
FreeBSD laptop.unixathome.org 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE  
#2: Wed Nov  7 10:54:48 EST 2007 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/ 
PCBSD  i386


Running PostgreSQL 8.3.0

Looking at ktrace output, I saw a lot of this:

1172 postgres CALL  kse_release(0xbfbfd500)
1172 postgres RET   kse_release -1 errno 22 Invalid argument

The ldd output for postgres is:

[EMAIL PROTECTED]:/usr/home/dan] $ ldd /usr/local/bin/postgres
/usr/local/bin/postgres:
libintl.so.8 = /usr/local/lib/libintl.so.8 (0x2835a000)
libxml2.so.5 = /usr/local/lib/libxml2.so.5 (0x28363000)
libssl.so.4 = /usr/lib/libssl.so.4 (0x2846f000)
libcrypto.so.4 = /lib/libcrypto.so.4 (0x2849d000)
libcrypt.so.3 = /lib/libcrypt.so.3 (0x2859)
libm.so.4 = /lib/libm.so.4 (0x285a8000)
libpthread.so.2 = /lib/libpthread.so.2 (0x285be000)
libc.so.6 = /lib/libc.so.6 (0x285e3000)
libiconv.so.3 = /usr/local/lib/libiconv.so.3 (0x286c9000)
libz.so.3 = /lib/libz.so.3 (0x287b6000)
[EMAIL PROTECTED]:/usr/home/dan] $

The server was compiled with these options:

[EMAIL PROTECTED]:~] $ less /var/db/ports/postgresql83/options
# This file is auto-generated by 'make config'.
# No user-servicable parts inside!
# Options for postgresql-client-8.3.0
_OPTIONS_READ=postgresql-client-8.3.0
WITH_NLS=true
WITHOUT_PAM=true
WITHOUT_LDAP=true
WITHOUT_MIT_KRB5=true
WITHOUT_HEIMDAL_KRB5=true
WITHOUT_OPTIMIZED_CFLAGS=true
WITH_XML=true
WITH_TZDATA=true
WITHOUT_DEBUG=true
WITHOUT_INTDATE=true
[EMAIL PROTECTED]:~] $



--
Dan Langille -- http://www.langille.org/
[EMAIL PROTECTED]





---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Andrew Dunstan



Alvaro Herrera wrote:

Gevik Babakhani wrote:
  

I have compiled 8.3 (CVS HEAD) with NLS on a XP box. But it seems that NLS
support is broke.
Could someone please confirm this.



What I can confirm is that lc_messages is supposed to work for to_char,
because it shows the localized output for me as I change lc_messages;
and it doesn't if I change lc_time.

  


FSVO supposed to.

The CVS history is somewhat murky.

On Nov 24 2006 this was committed dor src/backend/utils/adt/formatting.c:

r 1.114: Fix to_char() locale handling to honor LC_TIME, not LC_MESSAGES.

A few hours later it was supposedly reverted: r 1.115: Revert (too late 
in beta): Fix to_char() locale handling to honor LC_TIME, not LC_MESSAGES.


Apparently this was never returned to (it should probably have been put 
on the patches hold queue).


I can't see offhand what else might have caused the behaviour change.

cheers

andrew





---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Alvaro Herrera
Hiroshi Saito wrote:
 Hi

 --Document.--
 Table 9-22.
 TM prefix translation mode (print localized day and month names based on 
 lc_messages)
 --
 http://winpg.jp/~saito/pg_work/NLS_TO_CHAR_JP.png
 But, Although Japanese is out of condition

 Does the fundamental specification change?

Humm, I cannot read Japanese so as far as I can make, this is working fine?

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] postmaster in a tight loop

2008-02-12 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes:
 I find it a bit worrying that the postmaster is calling that syscall at
 all.

Yeah.  Misguided thread-aware library perhaps?

Next time please try to get a stack trace.

regards, tom lane

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [HACKERS] postmaster in a tight loop

2008-02-12 Thread Alvaro Herrera
Dan Langille wrote:

 Looking at ktrace output, I saw a lot of this:

 1172 postgres CALL  kse_release(0xbfbfd500)
 1172 postgres RET   kse_release -1 errno 22 Invalid argument

Humm, kse_release seems related to multithreading.  Or so says
http://nixdoc.net/man-pages/FreeBSD/kse_release.2.html

I find it a bit worrying that the postmaster is calling that syscall at
all.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Alvaro Herrera
Gevik Babakhani wrote:
 I have compiled 8.3 (CVS HEAD) with NLS on a XP box. But it seems that NLS
 support is broke.
 Could someone please confirm this.

What I can confirm is that lc_messages is supposed to work for to_char,
because it shows the localized output for me as I change lc_messages;
and it doesn't if I change lc_time.

In any case,

 Gevik=# show lc_messages ;
 lc_messages
 
  English_United States.1252
 (1 row)
 
 Gevik=#
 Gevik=# set lc_messages TO 'de_DE.utf8';
 SET

I wonder if this is really valid.  Shouldn't you be using a locale name
like 'German_Germany.65001' or some such?  I thought Windows did not
recognize the de_DE.utf8 form of names.  Perhaps it failed to raise an
error here?  It does for me:

alvherre=# set lc_time to 'fr_CA.utf8';
SET
alvherre=# set lc_time to 'de_DE.utf8';
ERROR:  valor no válido para el parámetro «lc_time»: «de_DE.utf8»

Suffice to say I don't have the de_DE locale installed.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Gevik Babakhani
 Right, I know that.  But I didn't see you trying lc_time as 
 Andrew suggested.
 

Did that too, but no luck :(


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Gevik Babakhani
 Well, that should be considered a bug, not a feature.  
 Perhaps it was fixed in 8.3.
 

This is 8.3 I am testing with.


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Alvaro Herrera
Gevik Babakhani wrote:
  Should that not be lc_time you are setting? lc_messages is 
  for, uh, messages.
 
 No. The same thing works on 8.2.6

Well, that should be considered a bug, not a feature.  Perhaps it was
fixed in 8.3.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Andrew Dunstan



Gevik Babakhani wrote:
Well, that should be considered a bug, not a feature.  
Perhaps it was fixed in 8.3.





This is 8.3 I am testing with.


  


You are missing Alvaro's point. He is  saying that the behaviour you 
relied on in 8.2.6 was a bug, and possibly you can no longer rely on the 
buggy behaviour in 8.3.


cheers

andrew

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

   http://www.postgresql.org/about/donate


Re: [HACKERS] Patch review

2008-02-12 Thread Stefan Kaltenbrunner

Martijn van Oosterhout wrote:

On Tue, Feb 12, 2008 at 05:49:12AM -0500, Bruce Momjian wrote:

There is no reason I have to host the list here.  I can _bounce_ emails
to any address.  Is there a service we can use that allows emails to be
accepted and displayed on a web site and that allows deletions and
comments, and has stable URLs for every email message?  Is there
software I can install on my server to do this?


debbugs? *duck*


debbugs is nice but it is more or less developed purely for debian with 
rarely any regular releases afaik ?



Stefan

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] Patch review

2008-02-12 Thread Martijn van Oosterhout
On Tue, Feb 12, 2008 at 05:49:12AM -0500, Bruce Momjian wrote:
 There is no reason I have to host the list here.  I can _bounce_ emails
 to any address.  Is there a service we can use that allows emails to be
 accepted and displayed on a web site and that allows deletions and
 comments, and has stable URLs for every email message?  Is there
 software I can install on my server to do this?

debbugs? *duck*

Personally I like trac for its simplicity. You can add comments and
post patches and track status. Which seems more than enough for what we
do.

Have a nice day,
-- 
Martijn van Oosterhout   [EMAIL PROTECTED]   http://svana.org/kleptog/
 Those who make peaceful revolution impossible will make violent revolution 
 inevitable.
  -- John F Kennedy


signature.asc
Description: Digital signature


Re: [HACKERS] Patch review

2008-02-12 Thread Gregory Stark
Bruce Momjian [EMAIL PROTECTED] writes:

 If we want to communicate via a web interface, I would still need a way
 to collect specific messages (not always entire threads).

You're talking about collecting messages. Everyone else wants to collect
patches or proposed changes. There's not a one-to-one mapping between the two.

One example of what we would want is a table in a wiki where it was easy to
insert a reference to the most current patch, a few pointers to messages where
it was discussed, and the current status.

Or something like the review-board dashboard which lists the patches under
consideration with their current status. Ideally with pgsql-patches gatewayed
to create new patches in the list and comments gatewayed back to the list.

I'm sure we want to communicate by email. We also want to have an interface we
can all use to maintain a queue of patches under consideration. They're two
separate, but related, things.

-- 
  Gregory Stark
  EnterpriseDB  http://www.enterprisedb.com
  Ask me about EnterpriseDB's On-Demand Production Tuning

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] Patch review

2008-02-12 Thread Stefan Kaltenbrunner

Gregory Stark wrote:

Bruce Momjian [EMAIL PROTECTED] writes:


If we want to communicate via a web interface, I would still need a way
to collect specific messages (not always entire threads).


You're talking about collecting messages. Everyone else wants to collect
patches or proposed changes. There's not a one-to-one mapping between the two.

One example of what we would want is a table in a wiki where it was easy to
insert a reference to the most current patch, a few pointers to messages where
it was discussed, and the current status.


yeah but generating that list is not so easy - in a perfect world that 
short overview list would be generated by whatever tool we use.




Or something like the review-board dashboard which lists the patches under
consideration with their current status. Ideally with pgsql-patches gatewayed
to create new patches in the list and comments gatewayed back to the list.


most modern trackers can do that more or less (like BZ can track 
conversations provided it has some way to infer what mail might be 
related to what bug/patch/featurerequest).
I'm trying to hack that feature up for the demo install to simply do 
that transparently for -bugs so that we can see this working for the 
simple case of -bugs without having to do any chances ...




I'm sure we want to communicate by email. We also want to have an interface we
can all use to maintain a queue of patches under consideration. They're two
separate, but related, things.


yes well but that interface could very well be a more featureful tracker 
that we use to generate that list ...



Stefan

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


[HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Gevik Babakhani
I have compiled 8.3 (CVS HEAD) with NLS on a XP box. But it seems that NLS
support is broke.
Could someone please confirm this.

My test:

Gevik=#
Gevik=# show lc_messages ;
lc_messages

 English_United States.1252
(1 row)

Gevik=#
Gevik=# set lc_messages TO 'de_DE.utf8';
SET
Gevik=# show lc_messages ;
 lc_messages
-
 de_DE.utf8
(1 row)

Gevik=# select to_char(now(), 'TMDay, DD TMMonth ');
  to_char
---
 Tuesday, 12 February 2008
(1 row)

Gevik=#
Gevik=# set lc_messages TO 'es_ES.utf8';
SET
Gevik=# show lc_messages ;
 lc_messages
-
 es_ES.utf8
(1 row)

Gevik=# select to_char(now(), 'TMDay, DD TMMonth ');
  to_char
---
 Tuesday, 12 February 2008
(1 row)





---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Andrew Dunstan



Gevik Babakhani wrote:

I have compiled 8.3 (CVS HEAD) with NLS on a XP box. But it seems that NLS
support is broke.
Could someone please confirm this.

My test:


Gevik=#
Gevik=# set lc_messages TO 'de_DE.utf8';
SET
Gevik=# show lc_messages ;
 lc_messages
-
 de_DE.utf8
(1 row)

Gevik=# select to_char(now(), 'TMDay, DD TMMonth ');
  to_char
---
 Tuesday, 12 February 2008
(1 row)


  


Should that not be lc_time you are setting? lc_messages is for, uh, 
messages.


cheers

andrew

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Gevik Babakhani
 Should that not be lc_time you are setting? lc_messages is 
 for, uh, messages.

No. The same thing works on 8.2.6


---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Alvaro Herrera
Gevik Babakhani wrote:
  Well, that should be considered a bug, not a feature.  
  Perhaps it was fixed in 8.3.
 
 This is 8.3 I am testing with.

Right, I know that.  But I didn't see you trying lc_time as Andrew
suggested.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] NLS on MSVC strikes back!

2008-02-12 Thread Gevik Babakhani
 to_char's month/day name localization is implemented with 
 gettext() not strftime(), which is why it depends on 
 LC_MESSAGES not LC_TIME.  I seem to recall that we didn't 
 like the side-effects of the patch you are mentioning, and so 
 it ended up being rejected outright.

Correct. I have been looking for the cause of this problem and
these are my finding:

1. The platforms discussed and tested here are MS Windows XP and 2003 using
Microsoft VC++ 2005 and NOT MINGW.

2. As Tom described above, to_char is implemented with gettext which depends
on LC_MESSAGES. I guess this is okay.

3. Changing LC_MESSAGES is done in pg_locale.c:94:pg_perm_setlocale by
setting LC_MESSAGES environment variable. This works for MINGW (tested by
installing PG 8.2.6), but it does not work for MSVC++ due different locale
handling of gettext. Please see gettext sources:1087:localenames.c

4. Locale names are different in MS Windows. I created a C app to test
gettext on Windows. 
setting LC_MESSAGES to Spanisg_Spain and German_Germany works but es_ES and
de_DE do not :(

SET LC_MESSAGES to '' has no effect because:

A. gettext compiled/linked in MSVC looks for the locale of the current
thread and NOT the LC_MESSAGES,LANGIAGE,LANG... environment variables. See
gettext's sources

B. Given current thread's locale Spanish_Spain, gettext fails to find a
directory called Spanish_Spain in share/locale. As result English names
are returned.

A possible solutions:

- Keep to_char/LC_MESSAGES handling and create a fix for B. 
Because we do not want to change/maintain our own version of Gettext this
would also involve creating a different directory/name structure for
Windows. For example share\locale\de would be share\locale\German_Germany.

Any thoughts,

Regards,
Gevik Babakhani

PostgreSQL NL   http://www.postgresql.nl
TrueSoftware BV http://www.truesoftware.nl


 


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Locale vs LIKE

2008-02-12 Thread Gregory Stark

Stephen Denne [EMAIL PROTECTED] writes:

 i.e. Do I still have to either initdb --locale=C or explicitly use
 text_pattern_ops?

yes, if you want an index to be used

-- 
  Gregory Stark
  EnterpriseDB  http://www.enterprisedb.com
  Ask me about EnterpriseDB's PostGIS support!

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster