Re: Question on Bizarre Sorting (ORDER BY in 7.1) - Mailing list pgsql-general

From Tom Lane
Subject Re: Question on Bizarre Sorting (ORDER BY in 7.1)
Date
Msg-id 29292.988216176@sss.pgh.pa.us
Whole thread Raw
In response to Question on Bizarre Sorting (ORDER BY in 7.1)  (<pgsql-general@commandprompt.com>)
List pgsql-general
<pgsql-general@commandprompt.com> writes:
> I was interested in knowing whether or not this
> is a bug, a change in the way PostgreSQL sorts, or possibly some kind of
> locale-specific misconfiguration?

There is not any (intentional) change in sorting behavior between 7.1
and earlier releases; indeed, since the sort order of text fields is
determined by libc's strcmp() or strcoll(), it would be pretty hard for
us to change it if we wanted to.  My money is on a locale issue ...
although the sorting behavior you describe doesn't seem to match any
commonly used locale.

Things to try:

Check whether you built with locale and/or multibyte support (and did
you make the same choices before?).

Use the contrib/pg_controldata program to see what locale the database
is initialized in.

Run the regression tests, both "make check" (which should force C
locale) and "make runtest" (which will talk to your installed postmaster
and hence use whatever locale it's using).  I'd not be surprised to get
some ordering differences in the runtest results.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: append all columns in where-clause
Next
From: Lieven Van Acker
Date:
Subject: Re: Joined table view - multiple delete action rule