yugabyte-db
yugabyte-db copied to clipboard
[YSQL] Colocation: Create table partition fails with colocation option
Jira Link: DB-9268
Description
For colocation, CREATE <table> PARTITION OF ... WITH (COLOCATION=FALSE/TRUE)
fails.
Example:
db1=# CREATE TABLE p4 PARTITION OF t FOR VALUES IN (4) WITH (COLOCATION=FALSE);
ERROR: cannot use 'colocation=true/false' with tablegroup
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
- [X] I confirm this issue does not contain any sensitive information.
Note: We support creating individual partitions as colocated or non-colocated via CREATE + ATTACH:
-- Create partitioned table
CREATE TABLE t (col int) PARTITION BY LIST (col);
-- Create a colocated partition
CREATE TABLE p1 (LIKE t INCLUDING ALL);
ALTER TABLE t ATTACH PARTITION p1 FOR VALUES IN (1);
-- Create a non-colocated partition
CREATE TABLE p2 (LIKE t INCLUDING ALL) WITH (COLOCATION=FALSE);
ALTER TABLE t ATTACH PARTITION p2 FOR VALUES IN (2);
However, if we try to use CREATE <table> PARTITION OF ... WITH (COLOCATION=FALSE)
(instead of ATTACH PARTITION), we fail with the above error. This defect tracks fixing this issue.
Issue resolved by commit 2cbb49d