The following script: CREATE TABLE pt1 (a int PRIMARY KEY) PARTITION BY RANGE (a); CREATE TABLE p1 PARTITION OF pt1 FOR VALUES FROM (0) TO (1);
CREATE TABLE pt2 (a int) PARTITION BY RANGE (a); CREATE TABLE p2 (a int, FOREIGN KEY (a) REFERENCES pt1);
ALTER TABLE pt2 ATTACH PARTITION p2 FOR VALUES FROM (0) TO (1); ALTER TABLE pt2 DETACH PARTITION p2;
fails with: ERROR: XX000: could not find ON INSERT check triggers of foreign key constraint 16404 LOCATION: GetForeignKeyCheckTriggers, tablecmds.c:11355
Reproduced on REL_15_STABLE (starting from f4566345c) .. master.
Hi,
This issue can't be reproduced on HEAD. I guess a commit happened to solve this problem.