Re: validating incoming string length...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux