pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
validating incoming string length...
2+ messages / 2 participants
[nested] [flat]

* validating incoming string length...
@ 2006-11-07 22:32 Steve Holdoway <steve@firetrust.com>
  2006-11-14 16:06 ` Re: validating incoming string length... Jerry Sievers <jerry@jerrysievers.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Steve Holdoway @ 2006-11-07 22:32 UTC (permalink / raw)
  To: pgsql-admin

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.

And yes, I inherited this!

Cheers,

Steve



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: validating incoming string length...
  2006-11-07 22:32 validating incoming string length... Steve Holdoway <steve@firetrust.com>
@ 2006-11-14 16:06 ` Jerry Sievers <jerry@jerrysievers.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Jerry Sievers @ 2006-11-14 16:06 UTC (permalink / raw)
  To: Steve Holdoway <steve@firetrust.com>; +Cc: pgsql-admin

Steve Holdoway <steve@firetrust.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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-11-14 16:06 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-11-07 22:32 validating incoming string length... Steve Holdoway <steve@firetrust.com>
2006-11-14 16:06 ` Jerry Sievers <jerry@jerrysievers.com>

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