Re: missed features and unhappy changes when pg 7.1->7.2

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: missed features and unhappy changes when pg 7.1->7.2
Дата
Msg-id 16133.1032532642@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: missed features and unhappy changes when pg 7.1->7.2  (Jeff Davis <list-pgsql-general@empires.org>)
Список pgsql-general
Jeff Davis <list-pgsql-general@empires.org> writes:
> A fair number of people were a little bugged about the change from silent
> truncation to throwing an error, including me.

BTW, after further study of the SQL spec we concluded that we still
didn't have it quite right.  7.3 will throw an error only during
implicit coercion to char(N) or varchar(N); an explicit coercion will
silently truncate.  For example:

update foo set varchar4col = '12345';            -- throws error

update foo set varchar4col = '12345'::varchar(4);    -- stores '1234'

Dunno if this will help either of you at this point; you've probably
already changed your apps to not need it.

>> And yet, what is the Right Way to deal with timestamp?

> Try, for example, replacing "timestamp" with datetime in the query you
> showed me.

Datetime is an obsolete alias for timestamptz ... it will go away in
7.3, so I'd recommend not using it now ...

            regards, tom lane

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

Предыдущее
От: Jeff Eckermann
Дата:
Сообщение: Re: REGEXP: returning match?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: timestamp parse error