Re: missed features and unhappy changes when pg 7.1->7.2 - Mailing list pgsql-general

From Tom Lane
Subject Re: missed features and unhappy changes when pg 7.1->7.2
Date
Msg-id 16133.1032532642@sss.pgh.pa.us
Whole thread Raw
In response to Re: missed features and unhappy changes when pg 7.1->7.2  (Jeff Davis <list-pgsql-general@empires.org>)
List 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 by date:

Previous
From: Jeff Eckermann
Date:
Subject: Re: REGEXP: returning match?
Next
From: Stephan Szabo
Date:
Subject: Re: timestamp parse error