"Karl O. Pinc" <[EMAIL PROTECTED]> writes:
> 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.

You mean like this?

regression=# create table foo (pk int primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table 
"foo"
CREATE TABLE
regression=# create table bar (fk int references foo);
CREATE TABLE
regression=# insert into bar values(1);
ERROR:  insert or update on table "bar" violates foreign key constraint "$1"
DETAIL:  Key (fk)=(1) is not present in table "foo".
regression=# select version();
                            version
---------------------------------------------------------------
 PostgreSQL 7.4.1 on hppa-hp-hpux10.20, compiled by GCC 2.95.3
(1 row)


                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to