Re: possible time change issue - known problem?

From: "Dan Langille" <dan(at)langille(dot)org>
To: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: possible time change issue - known problem?
Date: 2003-04-07 20:42:04
Message-ID: 3E91AA5C.20026.BBA8D9F@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)langille(dot)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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2003-04-07 20:51:33 FK deadlock problem addressed
Previous Message Holger Marzen 2003-04-07 20:25:15 Why no performance boost although I added an index?