Skip site navigation (1) Skip section navigation (2)

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

From: George Gensure <werkt0(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: patch - Report the schema along table name in a referential failure error message
Date: 2009-11-15 07:45:17
Message-ID: b47db0340911142345v60ae8c14n4cfd745b7c100a0b@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
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"

The error message only contains the schema if the table name being
referenced is non-unique or not present in the search_path.

It passes a make check, and I've added a couple of test cases which
expect the schema's output in the cases mentioned above.

Also, it looks like Rev 1.113 added spaces to the values specified in
errdetail for failed FK violations, but the testoutput wasn't updated.
 I haven't included that in this patch for clarity, but it probably
should be corrected.

Have at it,
-George

Attachment: fk_schemas.patch
Description: application/octet-stream (8.6 KB)

Responses

pgsql-hackers by date

Next:From: Andrew GierthDate: 2009-11-15 07:52:20
Subject: Re: NULL input for array_agg()?
Previous:From: Hitoshi HaradaDate: 2009-11-15 07:43:41
Subject: Re: add more frame types in window functions (ROWS)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group