pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
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: Sun, 06 Dec 2020 06:15:43 +0100
Message-ID: <03ede77a49f4e8085d885e0dc1c66128ebed8e27.camel@cybertec.at> (raw)
In-Reply-To: <67253506-9381-44ac-0bbd-5b4aea29cc19@enterprisedb.com>
References: <0DDE56FB-89A8-4621-BF5E-8CE3461F4983@mikatiming.de>
	<98a8cdc2-ed4b-616c-7370-3d5e5ccb8f91@enterprisedb.com>
	<2156565.1607098719@sss.pgh.pa.us>
	<67253506-9381-44ac-0bbd-5b4aea29cc19@enterprisedb.com>

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.

Yours,
Laurenz Albe






view thread (16+ messages)  latest in thread

Message-ID: <03ede77a49f4e8085d885e0dc1c66128ebed8e27.camel@cybertec.at>
Permalink:  ../03ede77a49f4e8085d885e0dc1c66128ebed8e27.camel@cybertec.at/
Also on:    postgresql.org/message-id/03ede77a49f4e8085d885e0dc1c66128ebed8e27.camel@cybertec.at

 · 

reply

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: laurenz.albe@cybertec.at, peter.eisentraut@enterprisedb.com, tgl@sss.pgh.pa.us, Dirk.Mika@mikatiming.de
  Subject: Re: Set COLLATE on a session level
  In-Reply-To: <03ede77a49f4e8085d885e0dc1c66128ebed8e27.camel@cybertec.at>
  References: <0DDE56FB-89A8-4621-BF5E-8CE3461F4983@mikatiming.de> <98a8cdc2-ed4b-616c-7370-3d5e5ccb8f91@enterprisedb.com> <2156565.1607098719@sss.pgh.pa.us> <67253506-9381-44ac-0bbd-5b4aea29cc19@enterprisedb.com> <03ede77a49f4e8085d885e0dc1c66128ebed8e27.camel@cybertec.at>

* 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