Re: Add column-name hint to log messages generated by inserts when varchars don't fit - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Add column-name hint to log messages generated by inserts when varchars don't fit
Date
Msg-id CA+TgmoYLziwCnWeDzTTVTY3LQa595Pk3Q1Ux0CxCjXrkQQ3TzQ@mail.gmail.com
Whole thread Raw
In response to Add column-name hint to log messages generated by inserts when varchars don't fit  ("Stepan Rutz" <Stepan.Rutz@gmx.de>)
List pgsql-hackers
On Wed, Aug 5, 2015 at 6:39 AM, Stepan Rutz <Stepan.Rutz@gmx.de> wrote:
> on our production servers I have quite some errors due to excessively long varchar-values which application-code
triesto insert into tables and which don't fit.
 
> The errors look like
>
>   ERROR:  value too long for type character varying(4)
>
> This is not helping me much. The patch will turn this too
>
>   ERROR:  value too long for type character varying(4) (hint: column-name is mycolumn)
>
> if the column that was overflown was mycolumn.

expression_tree_walker is used in enough different places that you
can't really modify that like this.  It'll have too many side effects
that may not be good.

Generally, the way to stick some useful information into the error
message is with an error context callback, rather than by appending to
the primary error message.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Patch for ginCombineData
Next
From: Robert Haas
Date:
Subject: Re: Dependency between bgw_notify_pid and bgw_flags