pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: mlipchuk@redhat.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8880: no indication of value when exceeded maximum length
Date: Tue, 21 Jan 2014 16:46:09 -0500
Message-ID: <20140121214609.GB29396@momjian.us> (raw)
In-Reply-To: <20140119161139.26703.79206@wrigleys.postgresql.org>
References: <20140119161139.26703.79206@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On Sun, Jan 19, 2014 at 04:11:39PM +0000, mlipchuk@redhat.com wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      8880
> Logged by:          Maor Lipchuk
> Email address:      mlipchuk@redhat.com
> PostgreSQL version: 9.2.3
> Operating system:   Fedora 18
> Description:        
> 
> When trying to insert a varchar value in a limited column which exceed the
> column limitation, we get an error of "value too long for type
> character(%d)).
> e.g varchar(5) --> value of 6 character "123456"
> 
> There is no indication which value exceeded the limitation and for big
> tables it is almost impossible to indicate the specific exceeded value.

Yes, that is odd.  If it was a constraint we would have printed out the
name of the constraint being violated, but type checking doesn't have
names and doesn't report which field is a problem.  I am not sure what
to recommend here.  I tried psql's \set VERBOSITY verbose, but that
didn't help:

	test=> \set VERBOSITY verbose
	test=> INSERT INTO test VALUES ('123456', '123456');
	ERROR:  22001: value too long for type character varying(5)
	LOCATION:  varchar, varchar.c:623

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <20140121214609.GB29396@momjian.us>
Permalink:  ../20140121214609.GB29396@momjian.us/
Also on:    postgresql.org/message-id/20140121214609.GB29396@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: bruce@momjian.us, mlipchuk@redhat.com
  Subject: Re: BUG #8880: no indication of value when exceeded maximum length
  In-Reply-To: <20140121214609.GB29396@momjian.us>
  References: <20140119161139.26703.79206@wrigleys.postgresql.org> <20140121214609.GB29396@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox