Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W5j9D-00018v-O1 for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Jan 2014 21:46:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W5j9D-0004Iu-5h for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Jan 2014 21:46:15 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W5j9B-0004H3-Er for pgsql-bugs@postgresql.org; Tue, 21 Jan 2014 21:46:13 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W5j98-0007ps-UD for pgsql-bugs@postgresql.org; Tue, 21 Jan 2014 21:46:12 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1W5j97-0001lm-QI; Tue, 21 Jan 2014 16:46:09 -0500 Date: Tue, 21 Jan 2014 16:46:09 -0500 From: Bruce Momjian To: mlipchuk@redhat.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #8880: no indication of value when exceeded maximum length Message-ID: <20140121214609.GB29396@momjian.us> References: <20140119161139.26703.79206@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140119161139.26703.79206@wrigleys.postgresql.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 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