Mac ordering with locales - Mailing list pgsql-general

From Pascal Cohen
Subject Mac ordering with locales
Date
Msg-id 47BD2F9D.3060408@wimba.com
Whole thread Raw
Responses Re: Mac ordering with locales
List pgsql-general
Hello
We are using different OS (Mac, win (with a small w!) and Linux).
We had some problems when doing some ordering on names.
I found that it seemed to be related on locale, While on Linux it used
default locales (en_US.UTF-8 or something like that), I had a nice
behavior).
I learned to check th lc_collate value to know on which locale ordering
was based.
I managed to create a DB under windows setting the right locale to
replace the default (en_US.UTF-8 instead of C) and it worked fine.
I tried to do the same under Mac but it still does not work.

A quick list of the kind of tasks I did:

Init the DB Cluster - initdb -D /tmp/data0 --locale='C'
Start the cluster - postgres -D /tmp/data0

Execute a query:
psql -d template1
select * from (VALUES ('a'),('B'),('b'),('A')) as f(name) order by name;
 name
------
 A
 B
 a
 b
(4 rows)


Init the DB Cluster - initdb -D /tmp/data1 --locale='en_US.UTF-8'
Start the cluster - postgres -D /tmp/data1

Execute a query:
psql -d template1
select * from (VALUES ('a'),('B'),('b'),('A')) as f(name) order by name;
 name
------
 a
 A
 b
 B
(4 rows)

The fact is that works on Linux and win but under Mac I always get the
ordering with 'default' C locale (I displayed all the lc_* and all are
right set)

Did I something wrong ?

Thanks

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: How to view temp tables
Next
From: Pascal Cohen
Date:
Subject: Feedback on PLJava