Thread: BUG #5135: sorting order

BUG #5135: sorting order

From
"Savita"
Date:
The following bug has been logged online:

Bug reference:      5135
Logged by:          Savita
Email address:      savita.halli@gmail.com
PostgreSQL version: 8.3.5
Operating system:   AIX
Description:        sorting order
Details:

Hi

I have 8.3.5 installed. The sorting order in potsgres would be determined by
lc_collate.

I am not passing the value of lc_collate during initdb. initdb takes the
value from locale of the system.

I see that with locale C/en_us and en_US.UTF-8, I get different sort for
same data in particular column of the table.

I would like to know if there is anyway we can get the same sorting order
irreespective of lc_collate value when doing the select query.

If yes, please let me know the select query.

If not, I would like to confirm if lc_collate value is used only for sorting
purpose. If so can I hardcode lc_collate value during initdb? does it affect
anyway the localization support of database.

Thanks in advance
Savita

Re: BUG #5135: sorting order

From
Tom Lane
Date:
"Savita" <savita.halli@gmail.com> writes:
> I would like to know if there is anyway we can get the same sorting order
> irreespective of lc_collate value when doing the select query.

You could do "ORDER BY col USING ~<~", but on the whole it's really
better to set LC_COLLATE the way you want.

            regards, tom lane