Skip site navigation (1) Skip section navigation (2)

Re: msvc++ build of 8.2.4 and encodings

From: Charlie Savage <cfis(at)savagexi(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: msvc++ build of 8.2.4 and encodings
Date: 2007-08-30 03:49:03
Message-ID: 46D63E2F.1010304@savagexi.com (view raw or flat)
Thread:
Lists: 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

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2007-08-30 04:33:03
Subject: Re: Advice on MyXactMade* flags, MyLastRecPtr, pendingDeletes and lazy XID assignment
Previous:From: Joshua D. DrakeDate: 2007-08-30 03:40:09
Subject: Re: Some more msvc++ 8.2.4 build feedback

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group