Re: LC_COLLATE=es_MX in PgSQL 7.3.2

Поиск
Список
Период
Сортировка
От Octavio Alvarez
Тема Re: LC_COLLATE=es_MX in PgSQL 7.3.2
Дата
Msg-id 200306131108.23088.alvarezp@alvarezp.ods.org
обсуждение исходный текст
Ответ на Re: LC_COLLATE=es_MX in PgSQL 7.3.2  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Список 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 по дате отправления:

Предыдущее
От: Ian Linwood
Дата:
Сообщение: Re: [HACKERS] SAP and MySQL ... [and Benchmark]
Следующее
От: Dennis Gearon
Дата:
Сообщение: Re: [HACKERS] SAP and MySQL ... [and Benchmark]