Re: value too long error

Поиск
Список
Период
Сортировка
От scott.marlowe
Тема Re: value too long error
Дата
Msg-id Pine.LNX.4.33.0403010859450.32148-100000@css120.ihs.com
обсуждение исходный текст
Ответ на value too long error  ("Rajat Katyal" <rajatk@intelesoftech.com>)
Ответы Re: value too long error
Список 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 по дате отправления:

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: efficient storing of urls
Следующее
От: Thomas Beutin
Дата:
Сообщение: Re: ORDER BY problem