Search Postgresql Archives

Re: Is it bad sorting in UTF ??

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

 



At 07:57 PM 4/14/2009, Richard Huxton wrote:
wstrzalka wrote:
Why PG sort's my data in case insensitive manner?

masterdb=# select name, setting from pg_settings WHERE name ilike 'lc
%';
    name     |   setting
-------------+-------------
 lc_collate  | en_US.UTF-8

Because that's what en_US.UTF-8 does. If you want "computer-style" sorting choose the "C" locale. You'll need to dump all your databases an re-initdb to do that I'm afraid. I believe 8.4 is going to allow different locales for each database though.

Is it possible to have something like:

select name from sometable order by collate(name,'en_US.UTF-8');
select name from sometable order by collate(name,'C');

Link.


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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