Re: String Comparison / Embedded Spaces

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: String Comparison / Embedded Spaces
Дата
Msg-id 20030722224310.F55110-100000@megazone.bigpanda.com
обсуждение исходный текст
Ответ на String Comparison / Embedded Spaces  (Ken Schenke <kschenke@datafreight.com>)
Ответы Re: String Comparison / Embedded Spaces  (Ron Johnson <ron.l.johnson@cox.net>)
Список pgsql-general
On Tue, 22 Jul 2003, Ken Schenke wrote:

> Does the PostgreSQL string comparison operator remove embedded spaces in
> a string before comparing?  Here is a query I'm issuing (notice the
> space between A and C in the first string):
>
> select version();
> select ('A C' < 'AB') as result;
>
> the result that comes back is:
>
> version
>
> -------------------------------------------------------------------------------------------------------
> PostgreSQL 7.3.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2
> 20030222 (Red Hat Linux 3.2.2-5)
>
> result
> ------
> f
>
> I searched the list archives and could not find a mention of this.
> Shouldn't the result of the comparison be true, not false?

That depends on the locale you have set for collation.  If it's en_US
(for example) spaces and some symbols don't act like you'd expect.
'AB' < 'A B' < 'AC' < 'A C' I believe.




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

Предыдущее
От: "Kian Spongsveen (spam account)"
Дата:
Сообщение: Question (or feature request) on serial datatype
Следующее
От: Jean-Christian Imbeault
Дата:
Сообщение: 0/1 vs true/false