From f1b4c771ea74f42447dccaed42ffcdcccf3aa694 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Wed, 4 Jan 2017 14:36:34 -0500 Subject: 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 --- src/backend/commands/tablecmds.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/backend/commands/tablecmds.c') diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 25620f5a7ea..7a5a574bbe2 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -1324,6 +1324,7 @@ ExecuteTruncate(TruncateStmt *stmt) rel, 0, /* dummy rangetable index */ false, + NULL, 0); resultRelInfo++; } -- cgit v1.2.3