REFERENCES error message complaint, suggestion - Mailing list pgsql-general

From Karl O. Pinc
Subject REFERENCES error message complaint, suggestion
Date
Msg-id 20040303171319.A13758@mofo.meme.com
Whole thread Raw
Responses Re: REFERENCES error message complaint, suggestion
List pgsql-general
FYI,

It'd be nice if the error message from a REFERENCES
constraint mentioned the column name into which
the bad data was attempted to be inserted.

In PostgreSQL 7.3:

sandbox=> insert into foo (id, b) values (3, 2);
ERROR:  b_is_fkey referential integrity violation - key referenced from
foo not found in bar

(I only know that column 'b' is involved above because I
manually gave the constraint the 'b_is_fkey' name.)

Also, IIRC, CHECK constraint violations don't contain the text of
the constraint, so you're again reduced to relying on supplied
constraint names for a clue as to what went wrong.  It'd be
nice to see the constraint itself in the error message.


Karl <kop@meme.com>
Free Software:  "You don't pay back, you pay forward."
                  -- Robert A. Heinlein

pgsql-general by date:

Previous
From: Michael Chaney
Date:
Subject: Re: Moving from MySQL to PGSQL....some questions (multilevel
Next
From: "Karl O. Pinc"
Date:
Subject: Re: Moving from MySQL to PGSQL....some questions (multilevel