On Mon, Apr 07, 2003 at 12:05:13PM -0400, Tom Lane wrote:
> "Dan Langille" <dan@langille.org> writes:
> > OK, I'll say again. The problem was not present on my 7.3.2 box but
> > was on the 7.2.3 box.
>
> Oh, I see: you're not testing the right thing. In 7.3, 'date - interval'
> promotes to 'timestamp without time zone - interval':
>
> regression=# select current_date, (current_date - interval '24 hours');
> date | ?column?
> ------------+---------------------
> 2003-04-07 | 2003-04-06 00:00:00
> (1 row)
>
> which is a crude but effective way of sidestepping the issue. But if
> you do the same calculation 7.2 did:
>
> regression=# select current_date, (current_date::timestamptz - interval '24 hours');
> date | ?column?
> ------------+------------------------
> 2003-04-07 | 2003-04-05 23:00:00-05
> (1 row)
>
> you'll still get the same unwanted result.
In case this is related, I get the following regression.diffs with today's cvs:
*** ./expected/horology.out Mon Apr 7 16:56:14 2003
--- ./results/horology.out Mon Apr 7 20:21:10 2003
***************
*** 571,577 ****
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True";
True
------
! t
(1 row)
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'tomorrow' - interval '1 day')) as "True";
--- 571,577 ----
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True";
True
------
! f
(1 row)
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'tomorrow' - interval '1 day')) as "True";
***************
*** 583,589 ****
SELECT (timestamp with time zone 'tomorrow' = (timestamp with time zone 'yesterday' + interval '2 days')) as "True";
True
------
! t
(1 row)
SELECT (timestamp with time zone 'tomorrow' > 'now') as "True";
--- 583,589 ----
SELECT (timestamp with time zone 'tomorrow' = (timestamp with time zone 'yesterday' + interval '2 days')) as "True";
True
------
! f
(1 row)
SELECT (timestamp with time zone 'tomorrow' > 'now') as "True";
======================================================================
Cheers,
Patrick
(NetBSD-1.6Q/i386 gcc 2.95.3nb4)