When a row fails a CHECK constraint, show row's contents in errdetail.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 29 Nov 2011 20:02:10 +0000 (15:02 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 29 Nov 2011 20:02:49 +0000 (15:02 -0500)
commitf1e13001b2ffff676b4b803db9ab439a1619dc4e
tree41d6765e6a40232a9cac5ca8cebdac7b96a6342d
parent9922fc5f9f02e9d1653d08b0e62cefa8560425be
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.
src/backend/executor/execMain.c
src/test/regress/expected/alter_table.out
src/test/regress/expected/domain.out
src/test/regress/expected/inherit.out
src/test/regress/output/constraints.source