Re: LC_COLLATE=es_MX in PgSQL 7.3.2

From: Octavio Alvarez <alvarezp(at)octavio(dot)ods(dot)org>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: LC_COLLATE=es_MX in PgSQL 7.3.2
Date: 2003-06-13 18:13:16
Message-ID: 200306131108.23088.alvarezp@alvarezp.ods.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-06-13 18:22:05 Re: [HACKERS] SAP and MySQL ... [and Benchmark]
Previous Message Ian Linwood 2003-06-13 18:10:20 Re: [HACKERS] SAP and MySQL ... [and Benchmark]