Re: How to pass around collation information

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to pass around collation information
Дата
Msg-id 4239.1275072522@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How to pass around collation information  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: How to pass around collation information  (Robert Haas <robertmhaas@gmail.com>)
Re: How to pass around collation information  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
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 guess the more general question is whether the spec expects that
collation settings can be derived statically (like type information)
or whether they might sometimes only be known at runtime.

We also need to think about whether we're okay with only applying
collation to built-in types (text, varchar, char) or whether we need
the feature to work for add-on types as well.  In particular, is citext
still a meaningful feature if we have this, or is it superseded by
COLLATE?  In the abstract I'd prefer to let it work for user-defined
types, but if we can have a much simpler implementation by not doing
so, it might be better to give that up.

Is COLLATE a property that can be attached to a domain over text?
        regards, tom lane


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

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