Re: Making pgsql error messages more developers' friendly. - Mailing list pgsql-general

From Tom Lane
Subject Re: Making pgsql error messages more developers' friendly.
Date
Msg-id 25634.1056698509@sss.pgh.pa.us
Whole thread Raw
In response to Re: Making pgsql error messages more developers' friendly.  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
Responses Re: Making pgsql error messages more developers' friendly.
List pgsql-general
"Nigel J. Andrews" <nandrews@investsystems.co.uk> writes:
> I was just looking at that fkey violation message yesterday and thinking how
> much better it would be to be able to see the offending value in the
> message. Is that what 7.4 shows?

You mean like this?

regression=# create table t1 (f1 int primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 't1_pkey' for table 't1'
CREATE TABLE
regression=# create table t2 (f2 int references t1);
NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
CREATE TABLE
regression=# insert into t2 values(42);
ERROR:  $1 referential integrity violation - key (f2)=(42) referenced from t2 not found in t1
regression=#

I'm still wondering how to rephrase this to fit in the
recently-agreed-to message style guidelines.  I think the
(col names)=(values) part must go into errdetail, but I'm
fuzzy beyond that.  Comments?

            regards, tom lane

pgsql-general by date:

Previous
From: Rajesh Kumar Mallah
Date:
Subject: Re: Making pgsql error messages more developers' friendly.
Next
From: u15074
Date:
Subject: Large Object table data file does not have expected size