Re: msvc++ build of 8.2.4 and encodings - Mailing list pgsql-hackers

From Charlie Savage
Subject Re: msvc++ build of 8.2.4 and encodings
Date
Msg-id 46D63E2F.1010304@savagexi.com
Whole thread Raw
In response to Re: msvc++ build of 8.2.4 and encodings  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: msvc++ build of 8.2.4 and encodings  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
Hi Andrew,

Thank for the reply.

>> In both cases, the database clusters were created like this:
>>
>> initdb ---locale=c --encoding=utf8;
>>
>>
> 
> That seems most unlikely - without the superfluous dash it should set 
> both lc_collate and lc_ctype to C.

Ah, sorry, that was a typo.  If you actually try it:

C:\WINDOWS\system32>initdb ---locale=C --encoding=utf8 c:\data_msvcc3
initdb: illegal option -- -locale=C

> 
> Please try the following in both cases:
> 
> initdb --no-locale --encoding=utf8 data
> pg_controldata data | grep LC_
> 
> If it doesn't show this:
> 
> LC_COLLATE:                           C
> LC_CTYPE:                             C
> 
> then that's a bug. 

With MSYS build:

initdb --no-locale --encoding=utf8 c:\data_msys

C:\WINDOWS\system32>pg_controldata c:\data_msys | grep LC_
LC_COLLATE:                           C
LC_CTYPE:                             C


[connect to postgres database]
show lc_collate                       C
show lc_ctype                         C
> create database test with encoding='utf8'

[switch to postgres database]
show lc_collate                       C
show lc_ctype                         C


With VC++ build:

initdb --no-locale --encoding=utf8 c:\data_msvcc

C:\WINDOWS\system32>pg_controldata c:\data_msvcc | grep LC_
LC_COLLATE:                           C
LC_CTYPE:                             C

show lc_collate                       C
show lc_ctype                         C
> create database test with encoding='utf8'

[switch to postgres database]
show lc_collate                       C
show lc_ctype                         C


Ok, so this works.

And if I use --locale=C for initdb it gives the same answers.

> Are you by any chance loading a library that calls setlocale() ?

Hmm.   Its postgresql 8.2.4 + tsearch2 + tree + postgis.  postgis in 
turn loads proj4 and geos.  I grepped through those 3 libraries source 
code and did not find any calls to setlocale.  So I don't think so.

So now I'm confused - if I go back to my other cluster that I originally 
wrote about (created with the MSVC++ build also) and create a database 
it has a different lc_collate (English_United States.1252").  Could this 
be from the dump/reload?

Charlie

pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Some more msvc++ 8.2.4 build feedback
Next
From: Tom Lane
Date:
Subject: Re: Advice on MyXactMade* flags, MyLastRecPtr, pendingDeletes and lazy XID assignment