Greg Stark <gsstark@MIT.EDU> writes:
> It's great to know which constraint was violated but that doesn't really help
> you figure out *why* it was violated.
On further thought it would never be feasible to do what the other poster is
really looking for. At least for table constraints it would require poking
through the expression to determine which columns might have caused the
violation.
Perhaps a better idea would be a debugging log message that dumped the entire
contents of a row update or insertion that fails due to any constraint. That
would be disabled normally but easy to enable and produce information that
would be very helpful for a dba loading data or doing large updates.
Especially if there's an option to complete the operation producing all the
errors before forcing the rollingback of the transaction.
--
greg