mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
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
This commit is contained in:
@ -5343,12 +5343,14 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap, LOCKMODE lockmode)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_CHECK_VIOLATION),
|
||||
errmsg("updated partition constraint for default partition \"%s\" would be violated by some row",
|
||||
RelationGetRelationName(oldrel))));
|
||||
RelationGetRelationName(oldrel)),
|
||||
errtable(oldrel)));
|
||||
else
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_CHECK_VIOLATION),
|
||||
errmsg("partition constraint of relation \"%s\" is violated by some row",
|
||||
RelationGetRelationName(oldrel))));
|
||||
RelationGetRelationName(oldrel)),
|
||||
errtable(oldrel)));
|
||||
}
|
||||
|
||||
/* Write the tuple out to the new relation */
|
||||
|
Reference in New Issue
Block a user