Re: patch for 9.2: enhanced errors
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Steve Singer <ssinger_pg@sympatico.ca>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2011-07-18T18:56:44Z
Lists: pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes: > There is only one issue, that should be solved first. I introduced non > standard diagnostics field "column_names", because there is not > possible get "column_name" value for check constraints now. A correct > implementation of COLUMN_NAME field needs a explicit relation between > pg_constraint and pg_attribute - maybe implemented as new column to > pg_constraint. Do you agree? No, I don't. You're adding complication to solve a problem that doesn't need to be solved. The standard says to return the name of the constraint for a constraint-violation failure. It does not say anything about naming the associated column(s). COLUMN_NAME is only supposed to be defined for certain kinds of errors, and this isn't one of them. regards, tom lane