Re: How to pass around collation information

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: How to pass around collation information
Дата
Msg-id AANLkTimrCVX3O_ug2GDGg9fJw5WOPfCGgikJb5MYSARw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to pass around collation information  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: How to pass around collation information  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On Fri, May 28, 2010 at 2:48 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
>> So while it's true that the collation is used by the operations (> and
>> ORDER BY), the information which collation to use comes with the data
>> values.  It's basically saying, a is in language "de", so sort it like
>> that unless told otherwise.  There is also an override syntax available,
>> like this:
>
>> SELECT * FROM test WHERE a COLLATE en > 'baz' ORDER BY b COLLATE sv;
>
> That seems fairly bizarre.  What does this mean:
>
>        WHERE a COLLATE en > b COLLATE de
>
> ?  If it's an error, why is this not an error
>
>        WHERE a COLLATE en > b
>
> if b is marked as COLLATE de in its table?

I think we need to think of the comparison operators as ternary, and
the COLLATE syntax applied to columns or present in queries as various
ways of setting defaults or explicit overrides for what the third
argument will end up being.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to pass around collation information
Следующее
От: Robert Haas
Дата:
Сообщение: Re: functional call named notation clashes with SQL feature