This is my result and what i think is what you expect. CREATE TABLE sorting (name varchar); labb=# \d sorting Table "public.sorting" Column | Type | Modifiers --------+-------------------+----------- name | character varying | labb=# INSERT INTO sorting VALUES('ta, a'); labb=# INSERT INTO sorting VALUES('ta, z'); labb=# INSERT INTO sorting VALUES('tab, a'); labb=# SELECT name FROM sorting ORDER BY name ASC; name -------- ta, a ta, z tab, a (3 rows) labb=# SELECT name FROM sorting ORDER BY name DESC; name -------- tab, a ta, z ta, a (3 rows) What locale do you have on that database? Best regards, Mathias Stjernström http://www.pastbedti.me/ On 20 aug 2008, at 22.36, Lennin Caro wrote:
I have a text field which I use to store names (lastname, firstname )and suppose we have the following 3 authors in thefield:ta, a ta, z tab, a I would expect them to show up in the order shownabove when I selectthis field and order it by it, but instead I get: ta, a tab, a ta, z Some one has suggested that this may have to do withmy localesetting. I'm not an administrator so I'm not sure whathow to check for thelocale setting or what to change it to. Does any onehave anysuggestions? I'm using postgres 8.1.11.can you show the query sintax?ok the result of the query is correct the string 'ta' is minor that 'tab' then 'ta, a' and 'ta, b' is minor to 'tab, a'. If you split the names you can order this-- Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin
Attachment:
PGP.sig
Description: This is a digitally signed message part