Re: Date and Time or Timestamp? - Mailing list pgsql-novice

From Josh Berkus
Subject Re: Date and Time or Timestamp?
Date
Msg-id 200304291731.42143.josh@agliodbs.com
Whole thread Raw
In response to Date and Time or Timestamp?  (Dave Stewart <dstewart@aquaflo.com>)
Responses Re: Date and Time or Timestamp?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Dave,

> On CMD's Practical Postgres page
> <http://www.commandprompt.com/ppbook/index.lxp?lxpwrap=x2632%2ehtm>,
> Table 3-14 claims a timestamp has a range of 1903AD to 2037AD.

Not at all correct, at least since 7.2.x:

staffos=# select version();
                            version
---------------------------------------------------------------
 PostgreSQL 7.2.4 on i686-pc-linux-gnu, compiled by GCC 2.95.3
(1 row)

staffos=# select '2099-09-27'::TIMESTAMP;
     timestamptz
---------------------
 2099-09-27 00:00:00
(1 row)

staffos=# select '2099-09-27'::TIMESTAMP + '30 days'::INTERVAL;
      ?column?
---------------------
 2099-10-27 00:00:00
(1 row)

staffos=# select '2999-09-27'::TIMESTAMP + '30 days'::INTERVAL;
      ?column?
---------------------
 2999-10-27 00:00:00
(1 row)

staffos=# select '8999-09-27'::TIMESTAMP + '30 days'::INTERVAL;
      ?column?
---------------------
 8999-10-27 00:00:00
(1 row)

I'll admit to not having tested 90,000 AD, but I think we can live with a Y10K
bug, don't you?

--
Josh Berkus
Aglio Database Solutions
San Francisco


pgsql-novice by date:

Previous
From: Dave Stewart
Date:
Subject: Date and Time or Timestamp?
Next
From: Tom Lane
Date:
Subject: Re: Date and Time or Timestamp?