Re: Very puzzling sort behavior

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Very puzzling sort behavior
Дата
Msg-id CAEYLb_VFc6w5EbsFL-GRd-0On3s8-wEKX4An3ykLuVoc2w6M8Q@mail.gmail.com
обсуждение исходный текст
Ответ на Very puzzling sort behavior  (Ken Tanzer <ken.tanzer@gmail.com>)
Ответы Re: Very puzzling sort behavior
Список pgsql-general
On Thu, Sep 10, 2015 at 12:35 PM, Ken Tanzer <ken.tanzer@gmail.com> wrote:
> Any thoughts about what's going on, what to do about it, or what obvious point I missing?  Thanks in advance!

This is the expected behavior. Locale rules will weigh the punctuation
character and space you added after primary alphabetical ordering.
Therefore, the 'E' in 'CLARKE' is more or less compared with the first
character of the first name in the case that you show, because those
code points are both what Unicode calls "primary weights".

You're not displaying the string you're ordering by anyway, so you can
just not concatenate the ', ' string (so name_last || name_first), and
it will work as you expect, I believe.

--
Regards,
Peter Geoghegan


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

Предыдущее
От: Ken Tanzer
Дата:
Сообщение: Very puzzling sort behavior
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: Very puzzling sort behavior