Re: bad error message

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jonathan Vanasco <postgres(at)2xlp(dot)com>
Cc: "A(dot)Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: bad error message
Date: 2006-10-12 23:39:37
Message-ID: 20992.1160696377@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jonathan Vanasco <postgres(at)2xlp(dot)com> writes:
> Yes, I know that part. The error message is bad though, because it
> doesn't tell me exactly where the error is.

> I got as an error
> ERROR: column "id" referenced in foreign key constraint does not exist

> I should have gotten something like
> ERROR: column "id" referenced in foreign key constraint on column
> "xyz" table "abc" does not exist

That's not necessarily all that much help, if you've got so many FK
constraints in your command that you don't know exactly where to look.
I think what you're really wishing for is an error cursor position.
8.2 has the infrastructure for this, eg

regression=# create table foo (a int, b int, c int);
CREATE TABLE
regression=# select a, b, q from foo;
ERROR: column "q" does not exist
LINE 1: select a, b, q from foo;
^
regression=#

but unfortunately the facility hasn't been extended to foreign key
constraint clauses in particular :-(. Maybe next time.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Staubo 2006-10-13 00:01:38 Re: Storing images in PostgreSQL databases (again)
Previous Message Robert L Mathews 2006-10-12 23:36:43 Re: Storing images in PostgreSQL databases (again)