Re: patch - Report the schema along table name in a referential failure error message

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: George Gensure <werkt0(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: patch - Report the schema along table name in a referential failure error message
Date: 2009-11-15 16:21:57
Message-ID: 19906.1258302117@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

George Gensure <werkt0(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2009-11-15 16:49:06 Re: Summary and Plan for Hot Standby
Previous Message Alex 2009-11-15 16:20:22 Re: Listen / Notify rewrite