Re: order by accents? - Mailing list pgsql-novice

From Manuel Sugawara
Subject Re: order by accents?
Date
Msg-id m3ya393hts.fsf@dep1.fciencias.unam.mx
Whole thread Raw
In response to Re: order by accents?  (ERIC Lawson - x52010 <eric@bioeng.washington.edu>)
List pgsql-novice
ERIC Lawson - x52010 <eric@bioeng.washington.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.

pgsql-novice by date:

Previous
From: vincent.millet@interiors.fr
Date:
Subject: oidvector Error with initdb
Next
From: Thomas Swan
Date:
Subject: Re: Auto Increment