George Gensure <wer...@gmail.com> writes:
> I've put together a small patch to provide a schema name in an fk
> violation in deference to the todo item "Report the schema along table
> name in a referential failure error message"

This is not the way forward; if it were, we would have done it years
ago.  Despite the poor wording of the TODO item, nobody is particularly
interested in solving this problem one error message at a time.
Furthermore, inserting the schema name into the text as you have done it
is 100% wrong --- in an example like
        ... table "non_searched_schema.fknsref" violates ...
the reader could be excused for thinking that the report is showing
an unqualified name that happens to include a dot, because that's
what double quotes imply in SQL.  And it certainly does not help
client-side tools that want to extract the full table name, which
is the real subtext behind many of the requests for this.

The direction that we really want to move in is to include the table and
schema names as well as other elements of the standard "diagnostics
area" as separate fields in error reports.  That will be a great deal
of work unfortunately :-( which is why it hasn't been tackled yet.

                        regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to