Re: How to get schema name which violates fk constraint - Mailing list pgsql-general

From Tom Lane
Subject Re: How to get schema name which violates fk constraint
Date
Msg-id 22398.1224683421@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to get schema name which violates fk constraint  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: How to get schema name which violates fk constraint  ("Andrus" <kobruleht2@hot.ee>)
Re: How to get schema name which violates fk constraint  (Ben Chobot <bench@silentmedia.com>)
Re: How to get schema name which violates fk constraint  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-general
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Scott Marlowe escribi�:
>> Actually this sounds like a TODO to me.  I imagine the db knows the
>> schema and it's just not reporting it in the error message.  Bruce?
>> Tom?

> Added -- it should be easy to do, so marked as such.

A comprehensive response to this type of gripe wouldn't be all that
"easy".  In the first place, there'd be a lot of code to touch.  In the
second place, the reason most of our messages don't already contain
schema names is that in the past we've judged it would be mostly
clutter; and given the infrequency of complaints I see no reason to
change that opinion.

The type of fix I'd like to see would be to not change message texts at
all, but to add separate error-message fields for the name and schema
name of object(s) involved in an error; which would be details that
psql, for example, would show only in VERBOSE mode.  Note that error
report fields along this line are actually required by the SQL spec
(cf GET DIAGNOSTICS) but we've never got round to implementing 'em.

            regards, tom lane

pgsql-general by date:

Previous
From: "Jonathan Bond-Caron"
Date:
Subject: Re: Shopping cart
Next
From: "Andrus"
Date:
Subject: Re: How to get schema name which violates fk constraint