Re: validating incoming string length...

From: Jerry Sievers <jerry(at)jerrysievers(dot)com>
To: Steve Holdoway <steve(at)firetrust(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: validating incoming string length...
Date: 2006-11-14 16:06:41
Message-ID: m37ixy9fn2.fsf@homie.jerrysievers.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Steve Holdoway <steve(at)firetrust(dot)com> 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Andy Shellam (Mailing Lists) 2006-11-14 16:25:35 Re: Finding out free space?
Previous Message Hans Guijt 2006-11-14 14:39:49 Finding out free space?