aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execMain.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-11-29 18:29:18 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2011-11-29 18:29:18 -0500
commitf225e4bc54df77e766b0edcffacb865648b099a3 (patch)
tree8eaefc7f41ecc92d86e5e5d240b92a5c542386a8 /src/backend/executor/execMain.c
parent8b08deb0d1ee04a82130e640e48e302a3456817a (diff)
downloadpostgresql-f225e4bc54df77e766b0edcffacb865648b099a3.tar.gz
postgresql-f225e4bc54df77e766b0edcffacb865648b099a3.zip
When a row fails a not-null constraint, show row's contents in errdetail.
Simple extension of previous patch for CHECK constraints.
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r--src/backend/executor/execMain.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index a6b26f6668a..3dbd80d53bc 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -1576,7 +1576,9 @@ ExecConstraints(ResultRelInfo *resultRelInfo,
ereport(ERROR,
(errcode(ERRCODE_NOT_NULL_VIOLATION),
errmsg("null value in column \"%s\" violates not-null constraint",
- NameStr(rel->rd_att->attrs[attrChk - 1]->attname))));
+ NameStr(rel->rd_att->attrs[attrChk - 1]->attname)),
+ errdetail("Failing row contains %s.",
+ ExecBuildSlotValueDescription(slot, 64))));
}
}