Re: How to make silently truncate for char type

Поиск
Список
Период
Сортировка
От Daniel Morgan
Тема Re: How to make silently truncate for char type
Дата
Msg-id JEEKLEDOLGOLOABENDFBAEJFCNAA.danmorg@sc.rr.com
обсуждение исходный текст
Ответ на How to make silently truncate for char type  (Terence Leung <tcmleung@yahoo.com>)
Список pgsql-general
Actually, I consider it normal behavior of a database to have an error if
the
data value length is greater than the defined length.  If it needs to be
truncated, you do
the truncate before you insert into the table.  This is the way it works on
enterprise databases like Oracle.  Maybe it was a bug in 7.1 that
automatically truncated for you.  I don't know for sure as I only have 7.2
installed.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org]On Behalf Of Terence Leung
Sent: Sunday, December 08, 2002 7:02 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] How to make silently truncate for char type


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


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

Предыдущее
От: Terence Leung
Дата:
Сообщение: How to make silently truncate for char type
Следующее
От: pginfo
Дата:
Сообщение: pg 7.3 memory error