From 33753ac9d7bc83dd9ccee9d5e678ed78a0725b4e Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Mon, 23 Mar 2020 08:09:15 +0530 Subject: Add object names to partition integrity violations. All errors of SQLSTATE class 23 should include the name of an object associated with the error in separate fields of the error report message. We do this so that applications need not try to extract them from the possibly-localized human-readable text of the message. Reported-by: Chris Bandy Author: Chris Bandy Reviewed-by: Amit Kapila and Amit Langote Discussion: https://postgr.es/m/0aa113a3-3c7f-db48-bcd8-f9290b2269ae@gmail.com --- src/backend/partitioning/partbounds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/backend/partitioning') diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c index 35953f23fa..4c47f54a57 100644 --- a/src/backend/partitioning/partbounds.c +++ b/src/backend/partitioning/partbounds.c @@ -1366,7 +1366,8 @@ check_default_partition_contents(Relation parent, Relation default_rel, ereport(ERROR, (errcode(ERRCODE_CHECK_VIOLATION), errmsg("updated partition constraint for default partition \"%s\" would be violated by some row", - RelationGetRelationName(default_rel)))); + RelationGetRelationName(default_rel)), + errtable(default_rel))); ResetExprContext(econtext); CHECK_FOR_INTERRUPTS(); -- cgit v1.2.1