Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 7D33E63281A for ; Tue, 20 Oct 2009 10:39:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 64553-02 for ; Tue, 20 Oct 2009 13:39:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from jupiter.marktest.pt (delta.marktest.pt [80.251.174.116]) by mail.postgresql.org (Postfix) with ESMTP id 8B9866327C5 for ; Tue, 20 Oct 2009 10:39:31 -0300 (ADT) Received: from Proteu (proteu.marktest.pt [10.61.90.54]) by jupiter.marktest.pt with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 4R8TK9TJ; Tue, 20 Oct 2009 14:39:24 +0100 Message-ID: <754C7C57E773410197FA4BF910DE9973@marktestcr.marktest.pt> From: "Oliveiros C," To: "Tom Lane" Cc: "Adrian Klaver" , References: <6caee9520910140240u13daba93ua20637642727776e@mail.gmail.com> <99F66F53142145DE8127EAF7423AF726@marktestcr.marktest.pt> <200910141354.17785.aklaver@comcast.net> <8017.1255973569@sss.pgh.pa.us> Subject: Re: How to order varchar data by word Date: Tue, 20 Oct 2009 14:39:23 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.101 tagged_above=-10 required=5 tests=AWL=0.083, BAYES_40=-0.185, STOX_REPLY_TYPE=0.001 X-Spam-Level: X-Archive-Number: 200910/75 X-Sequence-Number: 33274 Hello, Tom. Thank you for your e-mail Even though I am not familiar with the exact procedure to switch to other locales, I'm gonna research this more deeply. Anyway, I would appreciate if you could spare me some time and give me a couple of pointers to this subject. Again, thank you Best, Oliveiros ----- Original Message ----- From: "Tom Lane" To: "Oliveiros C," Cc: "Adrian Klaver" ; Sent: Monday, October 19, 2009 6:32 PM Subject: Re: [SQL] How to order varchar data by word > "Oliveiros C," writes: >> If any one can explain me exactly how the order by clause works on >> varchars, >> I 'd really appreciate it. > > It sorts according to the sort order imposed by your locale setting > (see LC_COLLATE in particular). > > A lot of locales have weird and wonderful rules that embody somebody's > notion of "dictionary order". If you don't like it, try switching to > C locale. Or you could learn enough about locale definitions to create > your own. > > regards, tom lane > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql