Re: Oder by not working

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Blanco, Jose" <blancoj(at)umich(dot)edu>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Oder by not working
Date: 2008-08-07 02:31:51
Message-ID: 19397.1218076311@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Blanco, Jose" <blancoj(at)umich(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2008-08-07 06:57:07 Re: Oder by not working
Previous Message Tom Lane 2008-08-06 19:37:16 Re: Hmm, nodeUnique doesn't really support backwards scan too well