Re: possible time change issue - known problem? - Mailing list pgsql-general

From Dan Langille
Subject Re: possible time change issue - known problem?
Date
Msg-id 3E91AA5C.20026.BBA8D9F@localhost
Whole thread Raw
In response to Re: possible time change issue - known problem?  (Patrick Welche <prlw1@newn.cam.ac.uk>)
List pgsql-general
On 7 Apr 2003 at 20:42, Patrick Welche wrote:

> 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";

Just in case it's relevent, the problem occur earlier in the day..
later in the day, the problem could not be reproduced.
--
Dan Langille : http://www.langille.org/


pgsql-general by date:

Previous
From: Holger Marzen
Date:
Subject: Why no performance boost although I added an index?
Next
From: Jan Wieck
Date:
Subject: FK deadlock problem addressed