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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Stepan Rutz <Stepan(dot)Rutz(at)gmx(dot)de>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add column-name hint to log messages generated by inserts when varchars don't fit
Date: 2015-08-08 14:08:35
Message-ID: CA+TgmoYLziwCnWeDzTTVTY3LQa595Pk3Q1Ux0CxCjXrkQQ3TzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 5, 2015 at 6:39 AM, Stepan Rutz <Stepan(dot)Rutz(at)gmx(dot)de> wrote:
> on our production servers I have quite some errors due to excessively long varchar-values which application-code tries to 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-08-08 14:16:23 Re: Dependency between bgw_notify_pid and bgw_flags
Previous Message Robert Haas 2015-08-08 14:04:04 Re: Patch for ginCombineData