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

From Tom Lane
Subject Re: possible time change issue - known problem?
Date
Msg-id 6044.1049731513@sss.pgh.pa.us
Whole thread Raw
In response to Re: possible time change issue - known problem?  ("Dan Langille" <dan@langille.org>)
Responses Re: possible time change issue - known problem?  (Patrick Welche <prlw1@newn.cam.ac.uk>)
List pgsql-general
"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.

            regards, tom lane


pgsql-general by date:

Previous
From: "Dan Langille"
Date:
Subject: Re: possible time change issue - known problem?
Next
From: Walt H
Date:
Subject: ODBC and LO questions....again.