]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Disallow partitionwise join when collations don't match
authorAmit Langote <amitlan@postgresql.org>
Fri, 8 Nov 2024 07:29:38 +0000 (16:29 +0900)
committerAmit Langote <amitlan@postgresql.org>
Fri, 8 Nov 2024 08:19:35 +0000 (17:19 +0900)
commita0cdfc8893673d1325f077b79f551aa105f360b8
treeaf394a467fbb7d6d8713973dc4b756cae3c5e157
parentb6484ca9535e947a068da01015620dfde0b9b488
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
src/backend/optimizer/util/relnode.c
src/test/regress/expected/collate.icu.utf8.out
src/test/regress/sql/collate.icu.utf8.sql