Re: Wrong result when enable_partitionwise_join is on if collation of PartitionKey and Column is different.
Tender Wang <tndrwang@gmail.com>
From: Tender Wang <tndrwang@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Amit Langote <amitlangote09@gmail.com>
Date: 2024-10-24T04:46:23Z
Lists: pgsql-hackers
Tender Wang <tndrwang@gmail.com> 于2024年10月23日周三 21:48写道: > Hi all, > > I find another issue as $SUBJECT when I work on [1]. > When I continue to work on this, I find below issue. But I'm not sure whether it is a bug. postgres=# create table part_index(a text primary key) partition by list ( a collate "POSIX"); ERROR: unique constraint on partitioned table must include all partitioning columns DETAIL: PRIMARY KEY constraint on table "part_index" lacks column "a" which is part of the partition key. postgres=# create table part_index(a text) partition by list ( a collate "POSIX"); CREATE TABLE postgres=# alter table part_index add primary key (a); ERROR: unique constraint on partitioned table must include all partitioning columns DETAIL: PRIMARY KEY constraint on table "part_index" lacks column "a" which is part of the partition key. It seems we can't create a primary key if the collation is different between columnDef and PartitionKey. By the way, I think the error message is misleading to users. ostgres=# alter table part_index add primary key (a); ERROR: unique constraint on partitioned table must include all partitioning columns DETAIL: PRIMARY KEY constraint on table "part_index" lacks column "a" which is part of the partition key. -- Thanks, Tender Wang
Commits
-
Disallow partitionwise join when collations don't match
- 075acdd93388 18.0 landed
- a0cdfc889367 17.1 landed
- f734b6b4d0cc 16.5 landed
- 33040b1715c7 15.9 landed
- 62df5484f976 14.14 landed
- 054701a2b77a 13.17 landed
- 9c4757491683 12.21 landed
-
Disallow partitionwise grouping when collations don't match
- 90fe6251c816 18.0 landed
- b6484ca9535e 17.1 landed
- dd2f8ebee221 16.5 landed
- 0a620659c549 15.9 landed
- 96f9b29a3e1e 14.14 landed
- ff65f695c0d3 13.17 landed
- 46d9be5efb1a 12.21 landed