Search Postgresql Archives

Mac ordering with locales

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux