Re: Historical dates in Timestamp

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Albert REINER" <areiner(at)tph(dot)tuwien(dot)ac(dot)at>
Cc: PostgreSQL-SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Historical dates in Timestamp
Date: 2001-04-04 16:36:53
Message-ID: 6253.986402213@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Albert REINER" <areiner(at)tph(dot)tuwien(dot)ac(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-04-04 17:01:15 Re: performance of functions - or rather lack of it
Previous Message Tom Lane 2001-04-04 16:07:17 Re: Strategy for unlocking query