pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Langote <amitlan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Disallow partitionwise join when collations don't match
Date: Fri, 08 Nov 2024 08:41:32 +0000
Message-ID: <E1t9KYd-000mra-Pr@gemulon.postgresql.org> (raw)

Disallow partitionwise join when collations don't match

If the collation of any join key column doesn’t match the collation of
the corresponding partition key, partitionwise joins can yield incorrect
results. For example, rows that would match under the join key collation
might be located in different partitions due to the partitioning
collation. In such cases, a partitionwise join would yield different
results from a non-partitionwise join, so disallow it in such cases.

Reported-by: Tender Wang <tndrwang@gmail.com>
Author: Jian He <jian.universality@gmail.com>
Reviewed-by: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Junwang Zhao <zhjwpku@gmail.com>
Discussion: https://postgr.es/m/CAHewXNno_HKiQ6PqyLYfuqDtwp7KKHZiH1J7Pqyz0nr+PS2Dwg@mail.gmail.com
Backpatch-through: 12

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/33040b1715c7a3450a6b3dc61bd7779a5f9ae709

Modified Files
--------------
src/backend/optimizer/util/relnode.c           |   4 +
src/test/regress/expected/collate.icu.utf8.out | 118 +++++++++++++++++++++++++
src/test/regress/sql/collate.icu.utf8.sql      |  22 +++++
3 files changed, 144 insertions(+)



view thread (7+ messages)  latest in thread

Message-ID: <E1t9KYd-000mra-Pr@gemulon.postgresql.org>
Permalink:  ../E1t9KYd-000mra-Pr@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1t9KYd-000mra-Pr@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: amitlan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Disallow partitionwise join when collations don't match
  In-Reply-To: <E1t9KYd-000mra-Pr@gemulon.postgresql.org>

* 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