pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Subject: Re: UNION versus collations
Date: Tue, 19 Nov 2024 06:56:34 +0100
Message-ID: <aecbaa08cc9b21187daf9304346c4e845c157753.camel@cybertec.at> (raw)
In-Reply-To: <3605568.1731970579@sss.pgh.pa.us>
References: <3605568.1731970579@sss.pgh.pa.us>

On Mon, 2024-11-18 at 17:56 -0500, Tom Lane wrote:
> prepunion.c's plan_union_children(), which merges
> identically-propertied UNION operations into one, has this comment:
> 
>  * NOTE: currently, we ignore collations while determining if a child has
>  * the same properties.  This is semantically sound only so long as all
>  * collations have the same notion of equality.  It is valid from an
>  * implementation standpoint because we don't care about the ordering of
>  * a UNION child's result: UNION ALL results are always unordered, and
>  * generate_union_paths will force a fresh sort if the top level is a UNION.
> 
> This argument seems well past its sell-by date.  In the first place,
> now that we have nondeterministic collations we can't assume that
> "all collations have the same notion of equality".
>
> [...]
>
> So I think we ought to apply the attached as far back as we have
> nondeterministic collations.

+1

This also reminded me of [1], where I cannot think of a good fix.

Yours,
Laurenz Albe

 [1]: https://postgr.es/m/8ef4899c4acfebca45cc6c042a6dc611d25ffab1.camel%40cybertec.at





view thread (2+ messages)

Message-ID: <aecbaa08cc9b21187daf9304346c4e845c157753.camel@cybertec.at>
Permalink:  ../aecbaa08cc9b21187daf9304346c4e845c157753.camel@cybertec.at/
Also on:    postgresql.org/message-id/aecbaa08cc9b21187daf9304346c4e845c157753.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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: laurenz.albe@cybertec.at, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: UNION versus collations
  In-Reply-To: <aecbaa08cc9b21187daf9304346c4e845c157753.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