"Karl O. Pinc" <kop(at)meme(dot)com> 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