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