diff options
author | Amit Kapila <akapila@postgresql.org> | 2020-03-23 08:09:15 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2020-03-23 08:09:15 +0530 |
commit | 33753ac9d7bc83dd9ccee9d5e678ed78a0725b4e (patch) | |
tree | 7e36f2908b8b926d036abec7c3b435213626385a /src/backend/executor/execMain.c | |
parent | 79dfa8afb296e1b0dcffbe674e04c5f25cc13dfd (diff) | |
download | postgresql-33753ac9d7bc83dd9ccee9d5e678ed78a0725b4e.tar.gz postgresql-33753ac9d7bc83dd9ccee9d5e678ed78a0725b4e.zip |
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
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r-- | src/backend/executor/execMain.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 28130fbc2b1..4fdffad6f35 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -1878,7 +1878,8 @@ ExecPartitionCheckEmitError(ResultRelInfo *resultRelInfo, (errcode(ERRCODE_CHECK_VIOLATION), errmsg("new row for relation \"%s\" violates partition constraint", RelationGetRelationName(resultRelInfo->ri_RelationDesc)), - val_desc ? errdetail("Failing row contains %s.", val_desc) : 0)); + val_desc ? errdetail("Failing row contains %s.", val_desc) : 0, + errtable(resultRelInfo->ri_RelationDesc))); } /* |