pgsql: Prevent display of dropped columns in row constraint violation m

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Prevent display of dropped columns in row constraint violation m
Date: 2013-11-07 19:42:00
Message-ID: E1VeVSq-0007rK-1r@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c28b289bf365ab11f23460d02a43667f6a8b8bc7

Modified Files
--------------
src/backend/executor/execMain.c | 47 +++++++++++++++++++++--------
src/test/regress/expected/alter_table.out | 14 +++++++++
src/test/regress/sql/alter_table.sql | 9 ++++++
3 files changed, 57 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2013-11-07 21:34:06 pgsql: Be more robust when strerror() doesn't give a useful result.
Previous Message Tom Lane 2013-11-07 18:14:40 pgsql: Fix generation of MergeAppend plans for optimized min/max on exp