Re: value too long error - Mailing list pgsql-general

From scott.marlowe
Subject Re: value too long error
Date
Msg-id Pine.LNX.4.33.0403010859450.32148-100000@css120.ihs.com
Whole thread Raw
In response to value too long error  ("Rajat Katyal" <rajatk@intelesoftech.com>)
Responses Re: value too long error
List pgsql-general
On Sat, 28 Feb 2004, Rajat Katyal wrote:

> Hi:
>
> Whenever i try to insert the data, size of which is greater than that of column datatype size,  I got the exception
valuetoo long for.....  
>
> However this was not in postgresql7.2.
>
> Can anyone please tell me, is there any way so that i wont get this exception. Please help me as soon as possible

As mentioned earlier, this is against spec (and for good reason,
databases, by default, shouldn't just toss away data that doesn't fit,
they should throw an error and prevent accidental data loss.)

That said, the easiest way to do this is to make the field a text type,
not a limited varchar, then create a before trigger that uses substring to
chop all but the first x characters and insert them.


pgsql-general by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: efficient storing of urls
Next
From: Thomas Beutin
Date:
Subject: Re: ORDER BY problem