Re: to_timestamp() changes in 8.4 release notes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: to_timestamp() changes in 8.4 release notes
Date
Msg-id 13188.1240153610@sss.pgh.pa.us
Whole thread Raw
In response to to_timestamp() changes in 8.4 release notes  (Brendan Jurd <direvus@gmail.com>)
Responses Re: to_timestamp() changes in 8.4 release notes
List pgsql-hackers
Brendan Jurd <direvus@gmail.com> writes:
> I noticed the following item under "Observe the following
> incompatibilities" in the 8.4 release notes (E.1.2.4.1.)

>   * Require to_timestamp() input to match meridian (AM/PM) and era
> (BC/AD) format designations with respect to presence of periods
> (Brendan Jurd)

>     For example, input value AD now does not match format string A.D..

> This is actually not a change in behaviour.

Well, it does seem to have some visible effect --- in 8.3 I see

regression=# select to_timestamp('1BC', 'YYYYA.D.');     to_timestamp      
------------------------0001-01-01 00:00:00-05
(1 row)

ie, failure to match means the field is silently ignored.  In HEAD,

regression=# select to_timestamp('1BC', 'YYYYA.D.');
ERROR:  invalid value "BC" for "A.D."
DETAIL:  The given value did not match any of the allowed values for this field.

ie, failure to match means you get an error.

I guess though your point is that this is part of the general tightening
of to_timestamp()'s error checking, and doesn't need a separate entry?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] unalias of ACL_SELECT_FOR_UPDATE
Next
From: Brendan Jurd
Date:
Subject: Re: to_timestamp() changes in 8.4 release notes