Re: postgres error reporting

From: Dmitry Tkach <dmitry(at)openratings(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: postgres error reporting
Date: 2003-02-28 19:01:34
Message-ID: 3E5FB20E.7060206@openratings.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches


Tom Lane wrote:

>Dima Tkach <dmitry(at)openratings(dot)com> writes:
>
>
>>What drives me crazy though is the way it reports referential integrity
>>violations:
>>
>>
>
>
>
>>ERROR: <unnamed> referential integrity violation - key referenced from
>>child not found in parent
>>
>>
>
>
>
>>Now, is it really that hard to tell *which* value for the key was not
>>found?
>>
>>
>
>Send a patch ;-)
>
>
Ok :-) Here it is.
There was also a bug, that I fixed in "no action" triggers - they were
setting the uid to the owner of the PK table, but actually looking at
the FK, so it would
barf if it was owned by a different user, with no 'select' permission to
the PK-owner....

There are actually *two* different patches - In ri_patch.txt I also took
the liberty to eliminate some code duplication by extracting the code,
common between all of the triggers into separate functions... if you
don't like that for some reason, there is a "lighter" version -
ri_msg_patch.txt, that only takes care about the error reporting, and
fixes that table owner problem, leaving everything else intact... Just
pick the one you like better...

These are both against REL7_3_STABLE. I compiled and tested them, and
did not see any problems...

If you need a separate version for the HEAD, let me know - I can send
that too...

Dima

Attachment Content-Type Size
ri_patch.txt text/plain 67.4 KB
ri_msg_patch.txt text/plain 12.8 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ian Harding 2003-02-28 19:57:02 tsearch trouble
Previous Message Jonathan Bartlett 2003-02-28 18:55:58 Re: Locking rows

Browse pgsql-patches by date

  From Date Subject
Next Message Dmitry Tkach 2003-02-28 19:14:00 Two patches
Previous Message greg 2003-02-28 15:03:14 Re: XML ouput for psql