Re: order by accents?

From: Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx>
To: ERIC Lawson - x52010 <eric(at)bioeng(dot)washington(dot)edu>
Cc: Patrick Coulombe <pcoulombe(at)mediacces(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: order by accents?
Date: 2000-07-10 19:29:03
Message-ID: m3ya393hts.fsf@dep1.fciencias.unam.mx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

ERIC Lawson - x52010 <eric(at)bioeng(dot)washington(dot)edu> writes:

>
> > hi,
> > if I do a query like this one :
> >
> > SELECT name from medias ORDER BY name
> >
> > name
> > ----
> > AAAA
> > CCCC
> > EEEE
> > VVVV
> > ZZZZ
> > CCC
> > ----
> > 6 rows
> >
> >
> > Why the record : CCC is at the end?
> > HOW can I fix this?

By default postgres uses the standard "C" locale to sort it's
results. Is your postgres installation compiled with locale support?,
If it is, you can use environment variables such as LC_CTYPE to tell
postgres how to sort characters. For example with LC_CTYPE=es
(Spanish) your select will return:

name
----
AAAA
CCCC
CCC
EEEE
VVVV
ZZZZ
----
6 rows

Which may be what you was expecting.

HTH.
Regards,
Manuel.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Paul Skinner 2000-07-10 21:30:20 pg_TCL and COMMIT
Previous Message Jacques Williams 2000-07-10 19:24:06 Re: Library Error