Re: Order By ignoring "-" character

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Wood <postgresql_question(at)attbi(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Order By ignoring "-" character
Date: 2003-06-07 15:18:16
Message-ID: 10604.1054999096@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dave Wood <postgresql_question(at)attbi(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2003-06-07 15:21:32 Re: Order By ignoring "-" character
Previous Message Henrik Steffen 2003-06-07 15:17:27 Re: update phenomenom