Re: LC_COLLATE=es_MX in PgSQL 7.3.2 - Mailing list pgsql-general

From Octavio Alvarez
Subject Re: LC_COLLATE=es_MX in PgSQL 7.3.2
Date
Msg-id 200306131108.23088.alvarezp@alvarezp.ods.org
Whole thread Raw
In response to Re: LC_COLLATE=es_MX in PgSQL 7.3.2  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List pgsql-general
On Wednesday 11 June 2003 21:34, Alvaro Herrera wrote:
> On Wed, Jun 11, 2003 at 04:40:42PM -0700, Octavio Alvarez wrote:
> > Ohh! Look at this... I think query #4 does not handle the accents
> > correctly, and it should behave almost like #5 does, except for the
> > record with p = 'R' which should be at the top (if they were #4's
> > results).
>
> I don't understand.  Are you saying that "ré" should sort the same as
> "RÉ", and that the ambiguity should be solved by the next column?  Well
> if it's that, I'm afraid it's not the way the locale is defined.

Yes. In fact, after doing some tests, I noticed that that doesn't even work
forn non-accented characters! For example, my name, OCTAVIO is different than
octavio. As of strcoll and strcmp, they will of course be different. If I
were only to sort by name, it would be correct to consider them as the
different values, but if sorting by name and last name ("alvarez", "rivera",
for instance), "OCTAVIO rivera" should be sorted AFTER "octavio ALVAREZ"
(which is not being done like that because "OCTAVIO" > "octavio" in the
sorting of the first column).

One approach would be sorting by name || ' ' || lastname, but I don't know how
that could slow down my queries. I will try that today.

Octavio.

pgsql-general by date:

Previous
From: Ian Linwood
Date:
Subject: Re: [HACKERS] SAP and MySQL ... [and Benchmark]
Next
From: Dennis Gearon
Date:
Subject: Re: [HACKERS] SAP and MySQL ... [and Benchmark]