pgsql: When a row fails a CHECK constraint, show row's contents in errd - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: When a row fails a CHECK constraint, show row's contents in errd
Date
Msg-id E1RVTtd-0002TE-FD@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
When a row fails a CHECK constraint, show row's contents in errdetail.

This should make it easier to identify which row is problematic when an
insert or update is processing many rows.

The formatting is similar to that for unique-index violation messages,
except that we limit field widths to 64 bytes since otherwise the message
could get unreasonably long.  (In particular, there's currently no attempt
to quote or escape field values that contain commas etc.)

Jan Kundrát, reviewed by Royce Ausburn, somewhat rewritten by me.

Branch
------
master

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

Modified Files
--------------
src/backend/executor/execMain.c            |   66 +++++++++++++++++++++++++++-
src/test/regress/expected/alter_table.out  |    9 ++++
src/test/regress/expected/domain.out       |    2 +
src/test/regress/expected/inherit.out      |    6 +++
src/test/regress/output/constraints.source |   20 ++++++++
5 files changed, 102 insertions(+), 1 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pgsql: pg_dump: Add gettext plural support to error message
Next
From: Bruce Momjian
Date:
Subject: pgsql: Suggest configure options for server developers.