Re: How to order varchar data by word

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Oliveiros C," <oliveiros(dot)cristina(at)marktest(dot)pt>
Cc: "Adrian Klaver" <aklaver(at)comcast(dot)net>, pgsql-sql(at)postgresql(dot)org
Subject: Re: How to order varchar data by word
Date: 2009-10-19 17:32:49
Message-ID: 8017.1255973569@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Oliveiros C," <oliveiros(dot)cristina(at)marktest(dot)pt> 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Gary Chambers 2009-10-19 21:54:13 Re: Efficiency in Multiple Queries of Same Table in a PL/PgSQL Function
Previous Message Oliveiros C, 2009-10-19 17:07:57 Re: How to order varchar data by word