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

From Tom Lane
Subject Re: REFERENCES error message complaint, suggestion
Date
Msg-id 20851.1078371468@sss.pgh.pa.us
Whole thread Raw
In response to REFERENCES error message complaint, suggestion  ("Karl O. Pinc" <kop@meme.com>)
Responses Re: REFERENCES error message complaint, suggestion
List pgsql-general
"Karl O. Pinc" <kop@meme.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

pgsql-general by date:

Previous
From: Matthew Hixson
Date:
Subject: using Postgres to store many small files
Next
From: scrappy@PostgreSQL.org
Date:
Subject: :)