]> granicus.if.org Git - postgresql/commit
Prevent display of dropped columns in row constraint violation messages.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 7 Nov 2013 19:41:43 +0000 (14:41 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 7 Nov 2013 19:41:43 +0000 (14:41 -0500)
commit8bd5a6af629141e0de1798570ea51db4bdabf6fe
tree51c6edc0a7acfc49e8236975face4d86bc4fb5af
parentaa8a2c3a612a867fc5348bd6ff68f619212e3c1b
Prevent display of dropped columns in row constraint violation messages.

ExecBuildSlotValueDescription() printed "null" for each dropped column in
a row being complained of by ExecConstraints().  This has some sanity in
terms of the underlying implementation, but is of course pretty surprising
to users.  To fix, we must pass the target relation's descriptor to
ExecBuildSlotValueDescription(), because the slot descriptor it had been
using doesn't get labeled with attisdropped markers.

Per bug #8408 from Maxim Boguk.  Back-patch to 9.2 where the feature of
printing row values in NOT NULL and CHECK constraint violation messages
was introduced.

Michael Paquier and Tom Lane
src/backend/executor/execMain.c
src/test/regress/expected/alter_table.out
src/test/regress/sql/alter_table.sql