Disallow partitionwise join when collations don't match
authorAmit Langote <[email protected]>
Fri, 8 Nov 2024 07:30:54 +0000 (16:30 +0900)
committerAmit Langote <[email protected]>
Fri, 8 Nov 2024 08:18:04 +0000 (17:18 +0900)
commit9c4757491683a10f0531bd206850d15dad8cadeb
tree513ac1400a47e4b600f6a402656aa811e76425be
parent46d9be5efb1a36328743d07e456cac5a1a40ec70
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 <[email protected]>
Author: Jian He <[email protected]>
Reviewed-by: Tender Wang <[email protected]>
Reviewed-by: Junwang Zhao <[email protected]>
Discussion: https://postgr.es/m/CAHewXNno_HKiQ6PqyLYfuqDtwp7KKHZiH1J7Pqyz0nr+PS2Dwg@mail.gmail.com
Backpatch-through: 12
src/backend/optimizer/path/joinrels.c
src/test/regress/expected/collate.icu.utf8.out
src/test/regress/sql/collate.icu.utf8.sql