Re: possible/feasible to specify field and value in error msg? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: possible/feasible to specify field and value in error msg?
Date
Msg-id 20130703151418.GA6521@momjian.us
Whole thread Raw
In response to possible/feasible to specify field and value in error msg?  (Willy-Bas Loos <willybas@gmail.com>)
Responses Re: possible/feasible to specify field and value in error msg?
List pgsql-hackers
On Wed, Jul  3, 2013 at 10:54:48AM +0200, Willy-Bas Loos wrote:
> Hi,
> 
> I have some complicated query that truncates and fills a table and i get this
> message:
> ERROR:  smallint out of range
> STATEMENT: <my huge query>
> This is in postgres 8.4
> I don't know where the error is, and the query takes rather long. So it is
> going to be a bit cumbersome for me to debug this.
> 
> Would it be possible/feasible to specify, in future versions of postgres:
> * what value
> * which field (of which table)
> * the offending tuple? (possibly truncated to some threshold nr of characters)
> 
> I ask because i can imagine that, inside the code that handles this, you might
> not have access to that information and adding access to it might be
> inefficient.
> 
> I do get the whole query of course, and that is very handy for automated
> things. But in this case, it doesn't help me.

We will add optional error details in Postgres 9.3:
http://momjian.us/main/blogs/pgblog/2013.html#April_11_2013

I don't know if an out-of-range error would generate the column name.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Add some regression tests for SEQUENCE
Next
From: Alvaro Herrera
Date:
Subject: Re: dynamic background workers