Justin Graf wrote:
I use locale en_US.UTF-8 but why this should affect how leading characters in strings are ignored is beyond me. Another, in my mind, counter-intuitive example: # create table tmp ( x text ) ; # insert into tmp(x) (values ('a'),('-b'),('c'),('aa'),('---a-b'),('ac'),('1'),('-2'),('+3'),('4'),('-'),('+')) ; # select * from tmp order by x ; x -------- - + 1 -2 +3 4 a aa ---a-b ac -b c (12 rows) In what universe would you expect this sort order? And how to make it 'sane'? I found a work-around, "order by ascii(x),x", but this continues to baffle me. It seems to me that if there are any alphanumeric characters in the string the rest are ignored in the sort. Where did this rule come from? I really would appreciate an explanation for this behavior. /Fredric PS. I was wrong about the server version, it is 8.3.8. |
begin:vcard fn:Fredric Fredricson n:Fredricson;Fredric org:Ln4 Solutions AB email;internet:Fredric.Fredricson@xxxxxxxxxxxxx title:CTO tel;home:+46 8 91 64 39 tel;cell:+46 70 677 58 48 version:2.1 end:vcard
-- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general