pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexandre GRAIL <a.grail@augure-ng.fr>
To: pgsql-general@lists.postgresql.org
Subject: Re: Set COLLATE on a session level
Date: Fri, 11 Dec 2020 09:54:20 +0100
Message-ID: <6c0e85fb-faad-7209-94b5-ca25c5b3002d@augure-ng.fr> (raw)
In-Reply-To: <0F3D30C2-8175-4453-9285-10584605E8DD@mikatiming.de>
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>
	<0F3D30C2-8175-4453-9285-10584605E8DD@mikatiming.de>

On 10/12/2020 19:33, Dirk Mika 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.
>>>
>> 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.

If that information appear in the explain output, you won’'t have to ask.

For people working in multilingual environment, a collation setting 
within session absolutely makes sense. So you don’t have to specify the 
same setting at each and every query. Also, the expected ordering do 
depends on the user who do the query (and his expectation from the 
language he’s working in) and *not* the data itself.

Regards










view thread (16+ messages)  latest in thread

Message-ID: <6c0e85fb-faad-7209-94b5-ca25c5b3002d@augure-ng.fr>
Permalink:  ../6c0e85fb-faad-7209-94b5-ca25c5b3002d@augure-ng.fr/
Also on:    postgresql.org/message-id/6c0e85fb-faad-7209-94b5-ca25c5b3002d@augure-ng.fr

 · 

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: a.grail@augure-ng.fr
  Subject: Re: Set COLLATE on a session level
  In-Reply-To: <6c0e85fb-faad-7209-94b5-ca25c5b3002d@augure-ng.fr>
  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> <0F3D30C2-8175-4453-9285-10584605E8DD@mikatiming.de> <6c0e85fb-faad-7209-94b5-ca25c5b3002d@augure-ng.fr>

* 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