Re: Set COLLATE on a session level

Поиск
Список
Период
Сортировка
От Dirk Mika
Тема Re: Set COLLATE on a session level
Дата
Msg-id 0F3D30C2-8175-4453-9285-10584605E8DD@mikatiming.de
обсуждение исходный текст
Ответ на Re: Set COLLATE on a session level  (Laurenz Albe <laurenz.albe@cybertec.at>)
Ответы Re: Set COLLATE on a session level
Список pgsql-general


--
Dirk Mika
Software Developer

mika:timing GmbH
Strundepark - Kürtener Str. 11b
51465 Bergisch Gladbach
Germany

fon +49 2202 2401-1197
dirk.mika@mikatiming.de
www.mikatiming.de

AG Köln HRB 47509 * WEEE-Reg.-Nr. DE 90029884
Geschäftsführer: Harald Mika, Jörg Mika


Am 06.12.20, 06:15 schrieb "Laurenz Albe" <laurenz.albe@cybertec.at>:

On Sat, 2020-12-05 at 13:12 +0100, Peter Eisentraut wrote:
> On 2020-12-04 17:18, Tom Lane wrote:
> > > There is a SET COLLATION command in the SQL standard that does this.
> > > Someone just has to implement it.  It wouldn't be terribly difficult, I
> > > think.
> >
> > [ squint... ]  Just because it's in the standard doesn't mean it's a
> > good idea.  It sounds like this is morally equivalent to a GUC that
> > changes query semantics.  We have learned painfully that such behaviors
> > are best avoided, because they break things you didn't expect to break.
>
> I think it would be analogous to the schema search path.

Usually you notice right away if the "search_path" is wrong, because
relations won't be found.

But with a bad collation set in a session, the problems would be more
subtle. For example, if someone asks you why an index isn't used to
support sorting, you'd always have to remember to ask what collation
has been set in the session.

This is true, but it is already the case in Oracle. There it is usually even the case that an index on a VARCHAR2
columnis not used for sorting, since the index is binary sorted, but the language setting is usually not.
 

The SET COLLATION command would be exactly what we're looking for. (

BR
Dirk


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

Предыдущее
От: Lars Vonk
Дата:
Сообщение: Re: Performance penalty during logical postgres replication
Следующее
От: Michael Lewis
Дата:
Сообщение: Re: Extended statistics for correlated columns, row estimates when values are not in MCVs list