Re: Order By ignoring "-" character - Mailing list pgsql-general

From Tom Lane
Subject Re: Order By ignoring "-" character
Date
Msg-id 10604.1054999096@sss.pgh.pa.us
Whole thread Raw
In response to Order By ignoring "-" character  (Dave Wood <postgresql_question@attbi.com>)
List pgsql-general
Dave Wood <postgresql_question@attbi.com> writes:
> Postgres not only seems to ignore the case of the text, implying a
> clause of "order by upper(name)", but it also seems to drop characters
> when doing the sort (the "-" and " " preceding the letters are not used
> during the order by).  Doing some digging on this subject seemed to
> imply that my locale was not set correctly somehow.  This is an
> out-of-the-box install of postgres from RedHat 9 in the en_US locale.
                                                          ^^^^^^^^^^^^

You need locale "C" if you want plain-ASCII sort order.  Unfortunately,
changing this requires a re-initdb (because it affects index ordering).

There are ongoing discussions about whether or not we should force C as
the default locale rather than accept the default from your environment.
It seems that some people will be confused and unhappy no matter which
way we do it :-(

            regards, tom lane

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Order By ignoring "-" character
Next
From: "Henrik Steffen"
Date:
Subject: Re: update phenomenom