Re: order by query wrong result

Поиск
Список
Период
Сортировка
От Silvio Brandani
Тема Re: order by query wrong result
Дата
Msg-id 546CC725.7000805@tech.sdb.it
обсуждение исходный текст
Ответ на Re: order by query wrong result  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: order by query wrong result
Список pgsql-admin
Hi,

I find this workaround:

CREATE OR REPLACE FUNCTION cleanup(text)
RETURNS text AS $$
SELECT replace(replace(replace($1, ' ','x'),'-','x'),'.','x')
$$ LANGUAGE sql;

and I get correct result :

select name
from prva
where name ilike 'savino del bene s%'
order by upper(cleanup(name));

Silvio Brandani


--

Il 19/11/2014 17:10, Tom Lane ha scritto:
> Silvio Brandani <silvio.brandani@tech.sdb.it> writes:
>> Hi,
>>    lc_collate
>> -------------
>>    en_US.UTF-8
> en_US (and, in fact, most Linux locales other than C) uses "dictionary
> order", which ignores pretty much everything except letters in its
> first-pass comparison.
>
> You can check that it's not just Postgres being weird by feeding the
> same data through sort(1) after setting LC_COLLATE this way in its
> environment.  You'll get the same results.
>
>             regards, tom lane
>


--------------------------------------------------------------------------------



This message is for the recipients only. If you receive it in error, please notify the sender and delete it together
withany attachments. For any further information, including our privacy policy please refer to
http://www.savinodelbene.com/privacy/



--------------------------------------------------------------------------------


В списке pgsql-admin по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: order by query wrong result
Следующее
От: Matheus de Oliveira
Дата:
Сообщение: Re: order by query wrong result