| 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: | Whole Thread | Raw Message | 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
| 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? |