Re: order by accents?

From: ERIC Lawson - x52010 <eric(at)bioeng(dot)washington(dot)edu>
To: Patrick Coulombe <pcoulombe(at)mediacces(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: order by accents?
Date: 2000-07-10 16:41:16
Message-ID: Pine.GSO.4.10.10007100930270.27288-100000@gandalf.bioeng.washington.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

I found a work-around for my problem (controlling the results of an "order
by") after observing that the sort-order was ascii-based. By using the
function lower(fieldname) or upper(fieldname), I get something
approximating what I would expect of an ordered last name list.

I suggest, non-authoritatively, that your problem with the accented E
character has a similar work-around by way of the translate function,
i.e., for the one character, something like

order by translate('fieldname','[accented E character]','E')

For more than one character, (e.g., accented E and accented U), it would
probably be best to write a function that translates all the characters
into characters that will fall in the correct spot in your list order.

Please note that I've very little idea what I'm talking about. For
example, I assume the sort order is locale-based, and will thus be
different for locales where the collating sequence is other than ASCII;
further, I assume the sort order can be tweaked via mechanisms with which
I'm totally unfamiliar.

Eric

James Eric Lawson
Research Publications Editor III
National Simulation Resource

eric(at)bioeng(dot)washington(dot)edu

On Fri, 7 Jul 2000, Patrick Coulombe wrote:

> 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?
>
> Thank you
> Patrick
>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message alias 2000-07-10 16:42:51
Previous Message Tom Lane 2000-07-10 15:05:32 Re: [NOVICE] newbie problem on creating table