ERROR:  update or delete on "ftp" violates foreign key constraint "$1"
on "ftp"
DETAIL:  Key (ftp_id)=(11) is still referenced from "ftp".

Considering I have several different FTP tables in various schemas, this
message doesn't have much detail. The "Error Message Style Guide" does
not indicate one way or the other whether tables, etc. should be fully
qualified or not. Possibly not in ERROR, but qualified makes sense for
DETAIL.
Mon, 18 Aug 2003 15:56:48 -0400
Rod Taylor <rbt@rbt.ca>
Qualified tables in error messages
Rod Taylor <rbt@rbt.ca> writes:
> Considering I have several different FTP tables in various schemas, this
> message doesn't have much detail. The "Error Message Style Guide" does
> not indicate one way or the other whether tables, etc. should be fully
> qualified or not. Possibly not in ERROR, but qualified makes sense for
> DETAIL.

I deliberately haven't done that because it would be awfully noisy.
It would be wrong to write only one set of quotes:

	ERROR: table "schema.foo" does not exist

since it's not clear here if the dot is in the name or not.  We'd have
to write

	ERROR: table "schema"."foo" does not exist

which is just plain ugly.

There are error fields defined in the SQL spec for table name, schema
name, etc, and at some point we should consider expanding the
error-message structure to allow passing those fields back to the
client --- *not* as part of the text messages, but as separate detail
fields.  Didn't get around to it for 7.4 though.

			regards, tom lane

Mon, 18 Aug 2003 21:29:13 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Qualified tables in error messages 
> since it's not clear here if the dot is in the name or not.  We'd have
> to write
> 
> 	ERROR: table "schema"."foo" does not exist
> 
> which is just plain ugly.

Yes, it certainly is.

> There are error fields defined in the SQL spec for table name, schema
> name, etc, and at some point we should consider expanding the

I see, this would be ideal.
Tue, 19 Aug 2003 02:07:45 +0000
Rod Taylor <rbt@rbt.ca>
Re: Qualified tables in error messages
> "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
> > ERROR: table "schema"."foo" does not exist
> >
> > which is just plain ugly.

Why not wrap all 'identifier' outputs in a call to the quoting function, so
the above message would in fact appear as:

table schema.foo does not exist

but with a space in it it would appear like this:

table "schema 2".foo does not exist

Chris


Wed, 20 Aug 2003 09:19:11 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: Qualified tables in error messages
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> Why not wrap all 'identifier' outputs in a call to the quoting function, so
> the above message would in fact appear as:
> table schema.foo does not exist
> but with a space in it it would appear like this:
> table "schema 2".foo does not exist

This doesn't conform to the message style guidelines we agreed to,
which specify quoting of user identifiers in messages.  I think the
guidelines are correct on this point --- consider for instance
	table exists does not exist
which could easily be a tad confusing...

			regards, tom lane

Wed, 20 Aug 2003 13:21:51 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Qualified tables in error messages 