mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-14 10:27:04 +08:00
Fix reporting of constraint violations for table partitioning.
After a tuple is routed to a partition, it has been converted from the root table's row type to the partition's row type. ExecConstraints needs to report the failure using the original tuple and the parent's tuple descriptor rather than the ones for the selected partition. Amit Langote
This commit is contained in:
@ -195,5 +195,11 @@ alter table p attach partition p1 for values from (1, 2) to (1, 10);
|
||||
insert into p values (1, 2);
|
||||
select tableoid::regclass, * from p;
|
||||
|
||||
truncate p;
|
||||
alter table p add constraint check_b check (b = 3);
|
||||
-- check that correct input row is shown when constraint check_b fails on p11
|
||||
-- after "(1, 2)" is routed to it
|
||||
insert into p values (1, 2);
|
||||
|
||||
-- cleanup
|
||||
drop table p, p1, p11;
|
||||
|
||||
Reference in New Issue
Block a user