Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 3AF599FB252 for ; Tue, 14 Nov 2006 12:07:05 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 99689-07 for ; Tue, 14 Nov 2006 16:07:01 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 6FAF39FB250 for ; Tue, 14 Nov 2006 12:06:57 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from mama.jerrysievers.com (adsl-64-118-249-70.netrox.net [64.118.249.70]) by svr4.postgresql.org (Postfix) with ESMTP id 8F3DF5AF8F6 for ; Tue, 14 Nov 2006 16:06:54 +0000 (GMT) Received: from homie.jerrysievers.com (homie.jerrysievers.com [192.168.1.7]) by mama.jerrysievers.com (8.13.7/8.13.7) with ESMTP id kAEG6haC002899; Tue, 14 Nov 2006 11:06:43 -0500 Received: from homie.jerrysievers.com (localhost.localdomain [127.0.0.1]) by homie.jerrysievers.com (8.13.7/8.13.7) with ESMTP id kAEG6hDC015184; Tue, 14 Nov 2006 11:06:43 -0500 Received: (from jerry@localhost) by homie.jerrysievers.com (8.13.7/8.13.7/Submit) id kAEG6ftf015179; Tue, 14 Nov 2006 11:06:41 -0500 To: Steve Holdoway Cc: pgsql-admin@postgresql.org Subject: Re: validating incoming string length... References: <20061108113246.f910a989.steve@firetrust.org> From: Jerry Sievers Date: 14 Nov 2006 11:06:41 -0500 In-Reply-To: <20061108113246.f910a989.steve@firetrust.org> Message-ID: Lines: 18 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/140 X-Sequence-Number: 23667 Steve Holdoway writes: > I'm trying to write a pl/pgsql trigger to validate incoming data to > an existing database. One of the fields is defined as character > varying (255). Is there any way of catching over-length data on > inserts and silently dropping them? At the moment, I'm getting the > error 'ERROR: value too long for type character varying(255)' no > matter what I try. Sure. Change the columns data type to text where you'll have no size restriction and then let your trigger gun those illegal entries. HTH -- ------------------------------------------------------------------------------- Jerry Sievers 305 854-3001 (home) Production Database Administrator 305 321-1144 (mobil WWW E-Commerce Consultant