Re: possible/feasible to specify field and value in error msg?

From: Willy-Bas Loos <willybas(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: possible/feasible to specify field and value in error msg?
Date: 2013-07-04 08:51:50
Message-ID: CAHnozTisx03U10jXc=s-bfXjSDn3hKfuqQ2dQDzKnHSnaVOrOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 3, 2013 at 5:18 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:

> On Wed, Jul 3, 2013 at 11:14:18AM -0400, Bruce Momjian wrote:
> > We will add optional error details in Postgres 9.3:
> >
> > http://momjian.us/main/blogs/pgblog/2013.html#April_11_2013
>

> I just tested this and it doesn't show the offending column name;
> sorry:
>
> test=> CREATE TABLE test(x smallint);
> CREATE TABLE
> test=> \set VERBOSITY verbose
> test=> INSERT INTO test VALUES (10000000);
> ERROR: 22003: smallint out of range
> LOCATION: i4toi2, int.c:349
>
>

It's great to see that you people care about "userland", judging by the
effort that you describe in your article.
In fact you're already doing the thing that i asked about, i see that even
the offending tuple is printed (which is new).
And of course it's not necessary to mention the column name when you
mention the constraint name.
(BTW: your remark about NOT NULL constraints is not necessary, that error
message is very clear:"ERROR: null value in column "balance" violates
not-null constraint" )

This is not a constraint going off, and in this case, none of that applies.
But it seems probable to me that some day it will, seeing as you already
implemented it for constraints.

Thanks,

Willy-Bas Loos

--
"Quality comes from focus and clarity of purpose" -- Mark Shuttleworth

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2013-07-04 08:59:34 Re: possible/feasible to specify field and value in error msg?
Previous Message Dimitri Fontaine 2013-07-04 08:15:24 Re: event trigger API documentation?