Re: Oder by not working - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Oder by not working
Date
Msg-id 19397.1218076311@sss.pgh.pa.us
Whole thread Raw
In response to Oder by not working  ("Blanco, Jose" <blancoj@umich.edu>)
List pgsql-bugs
"Blanco, Jose" <blancoj@umich.edu> writes:
> Suppose we have the following 3 names in a table:

>  Ta, A
>  Ta, Z
>  Tab, A

> I would expect them to show up in the oder shown above when odering by
> by name, but instead I get:

>  Ta, A
>  Tab, A
>  Ta, Z

This is not a bug.  Or at least you have not offered any evidence that
suggests that it is a bug.  What's more likely is that this is the
standard sort order in the locale you're using, and that you need to
change to a different database locale to get the order you like.
("initdb --locale=C" might be what you want.)

For comparison's sake, I get this on a modern Linux system:

$ cat testdata
Ta, A
Ta, Z
Tab, A
$ LANG=C sort testdata
Ta, A
Ta, Z
Tab, A
$ LANG=en_US sort testdata
Ta, A
Tab, A
Ta, Z

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Hmm, nodeUnique doesn't really support backwards scan too well
Next
From: "Heikki Linnakangas"
Date:
Subject: Re: Oder by not working