Re: Historical dates in Timestamp - Mailing list pgsql-sql

From Tom Lane
Subject Re: Historical dates in Timestamp
Date
Msg-id 6253.986402213@sss.pgh.pa.us
Whole thread Raw
In response to Historical dates in Timestamp  ("Albert REINER" <areiner@tph.tuwien.ac.at>)
List pgsql-sql
"Albert REINER" <areiner@tph.tuwien.ac.at> writes:
> Is it really reasonable to enforce that the number of years is four
> digits at least?

I believe so.  Without that cue it's pretty difficult for the timestamp
parser even to figure out which field is intended to be the year, let
alone whether you'd like 1900 or 2000 added to a two-digit year value.

For example, with the default datestyle:

regression=# select '12-5-28'::timestamp;       ?column?
------------------------2028-12-05 00:00:00-05
(1 row)

regression=# select '0012-5-28'::timestamp;     ?column?
---------------------0012-05-28 00:00:00
(1 row)
        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Strategy for unlocking query
Next
From: Tom Lane
Date:
Subject: Re: performance of functions - or rather lack of it