Mac ordering with locales

From: Pascal Cohen <pcohen(at)wimba(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Mac ordering with locales
Date: 2008-02-21 08:00:29
Message-ID: 47BD2F9D.3060408@wimba.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pascal Cohen 2008-02-21 08:17:32 Feedback on PLJava
Previous Message Scott Marlowe 2008-02-21 07:28:16 Re: How to view temp tables