lc_collate issue

Поиск
Список
Период
Сортировка
Искать
От
Cody Pisto
Тема
lc_collate issue
Дата
Msg-id
46CF16F9.5020807@rvweb.com
Список
Дерево обсуждения
lc_collate issue Cody Pisto <cpisto@rvweb.com>
Re: lc_collate issue Tom Lane <tgl@sss.pgh.pa.us>
Re: lc_collate issue Cody Pisto <cpisto@rvweb.com>
Re: lc_collate issue Tom Lane <tgl@sss.pgh.pa.us>
Re: lc_collate issue Cody Pisto <cpisto@rvweb.com>
Re: lc_collate issue db@zigo.dhs.org
Re: lc_collate issue Peter Eisentraut <peter_e@gmx.net>
Re: lc_collate issue "Karsten Hilbert" <Karsten.Hilbert@gmx.net>
Re: lc_collate issue Tom Lane <tgl@sss.pgh.pa.us>
Re: lc_collate issue Tatsuo Ishii <ishii@postgresql.org>
Hi All,

I'm looking for any kind of a reason (and potential workarounds), be it 
bug or otherwise, why the following two queries produce different 
results under a database encoding of UTF8 and lc_collate of en_US.UTF-8:

SELECT x FROM (SELECT 'Something else' AS x UNION SELECT '-SOMETHING 
ELSE-' AS x UNION SELECT 'Somethang' AS x) y ORDER BY LOWER(x)

        x
------------------
 Somethang
 -SOMETHING ELSE-
 Something else
(3 rows)


*AND*

SELECT x FROM (SELECT 'Somethingelse' AS x UNION SELECT 
'-SOMETHINGELSE-' AS x UNION SELECT 'Somethang' AS x) y ORDER BY LOWER(x)

        x
-----------------
 Somethang
 Somethingelse
 -SOMETHINGELSE-


The removal of spaces from the strings gives "more correct" sorting 
results, with the spaces and '-' characters, '-SOMETHING ELSE-' is 
strangely sorted in the middle?
It does not matter if you use LOWER or UPPER, and the "problem" does not 
occur on databases with encoding SQL_ASCII and lc_collate of C

I have tested this on Postgres 8.1.9, 8.2, 8.2.4 with database encoding 
of UTF8 and lc_collate of en_US.UTF8
and on 7.4.16 with database encoding of SQL_ASCII and lc_collate of C

Thank in advance for any consideration!


-Cody

В списке pgsql-general по дате отправления
От: Oleg Bartunov
Дата:
От: Joshua D. Drake
Дата:
Сообщение: Re: Out of Memory - 8.2.4
FAQ