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.