Re: funkiness with '1999-12-31 19:00:00-05'::timestamp with time zone

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Josh Kupershmidt <schmiddy(at)gmail(dot)com>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: funkiness with '1999-12-31 19:00:00-05'::timestamp with time zone
Date: 2010-09-03 19:36:43
Message-ID: 28273.1283542603@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

[ trivia warning ]

I wrote:
> We don't make any great effort to expose that though. It looks like
> the closest value that timestamptzin makes different from zero is

> regression=# select extract(epoch from '1999-12-31 19:00:00.00000000001-05' - '1999-12-31 19:00:00-05'::timestamptz) ;
> date_part
> ----------------------
> 1.45519152283669e-11
> (1 row)

Actually, it looks like the precision is being limited by the rotation
from EST zone. In GMT zone I can do this:

regression=# select extract(epoch from '2000-01-01 00:00:00.0000000000000000000000000000000000000000000000000000000000000000001'::timestamptz - '2000-01-01 00:00:00');
date_part
-----------
1e-67
(1 row)

and it could go a lot smaller except there's an arbitrary limit on
the length of input string that timestamptzin will take.

If float timestamps weren't deprecated it might be worth trying to make
this behave less surprisingly.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-09-03 19:40:37 Re: funkiness with '1999-12-31 19:00:00-05'::timestamp with time zone
Previous Message Josh Kupershmidt 2010-09-03 19:35:36 Re: funkiness with '1999-12-31 19:00:00-05'::timestamp with time zone