Re: How to make silently truncate for char type

Поиск
Список
Период
Сортировка
От Aasmund Midttun Godal
Тема Re: How to make silently truncate for char type
Дата
Msg-id E18LCYV-00065L-00@mail.krot.org
обсуждение исходный текст
Ответ на How to make silently truncate for char type  (Terence Leung <tcmleung@yahoo.com>)
Ответы functions + shared libraries  (Eric B.Ridge <ebr@tcdi.com>)
Список pgsql-general
Creating a rule/trigger (before insert) with the appropriate substr
function would, I imagine, do the trick.

Regards,

Aasmund

* Terence Leung <tcmleung@yahoo.com> wrote:
> I upgraded postgresql 7.1 to 7.2 and found that many
> sql cannot execute because version 7.2 does not
> silently truncate the string for char(n) type during
> insert a new row.
> e.g. insert t (field1) value ('abcdef');
>      where field1 is char(5) but I insert the string
> has 6 characters.
>
> How can I solve the problem except downgrade the
> Postgresql?
>
> Looking forward to your reply!!!
>
> =====
> Yours sincerely,
>     Leung Chun Man, Terence
>
>     Mobile: (852) 9273 9176
>     Homepage:  http://tcmleung.uhome.net ,
>     http://www.dynamicdrive.com/dynamicindex4/filter/index.htm
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>

Aasmund Midttun Godal

aasmund@godal.com - http://www.godal.com/
+47 40 45 20 46 - Elgesetergt. 26B, N-7030 Trondheim

В списке pgsql-general по дате отправления:

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: UPDATE syntax problem
Следующее
От: Hiroshi Inoue
Дата:
Сообщение: Re: 7.3 no longer using indexes for LIKE queries