From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Dirk Mika <Dirk.Mika@mikatiming.de>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Set COLLATE on a session level
Date: Fri, 04 Dec 2020 11:18:39 -0500
Message-ID: <2156565.1607098719@sss.pgh.pa.us> (raw)
In-Reply-To: <98a8cdc2-ed4b-616c-7370-3d5e5ccb8f91@enterprisedb.com>
References: <0DDE56FB-89A8-4621-BF5E-8CE3461F4983@mikatiming.de>
<98a8cdc2-ed4b-616c-7370-3d5e5ccb8f91@enterprisedb.com>
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
> On 2020-11-20 08:13, Dirk Mika wrote:
>> I know that I can specify a COLLATE for a SELECT statement in the ORDER BY Clause, but then I would have to adjust the statements in the client and statements that are automatically generated by the database components used, would not be affected.
> 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 also wonder just exactly what such a setting would do, and how it
interacts with the existing rules for deriving collations within a
query. Does parse_collate.c go out the window the minute somebody
sets a non-empty collation setting?)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, peter.eisentraut@enterprisedb.com, Dirk.Mika@mikatiming.de
Subject: Re: Set COLLATE on a session level
In-Reply-To: <2156565.1607098719@sss.pgh.pa.us>
References: <0DDE56FB-89A8-4621-BF5E-8CE3461F4983@mikatiming.de> <98a8cdc2-ed4b-616c-7370-3d5e5ccb8f91@enterprisedb.com> <2156565.1607098719@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox