Re: possible time change issue - known problem?

From: "Dan Langille" <dan(at)langille(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: possible time change issue - known problem?
Date: 2003-04-07 15:56:56
Message-ID: 3E916788.14623.AB57E7C@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7 Apr 2003 at 11:37, Tom Lane wrote:

> "Dan Langille" <dan(at)langille(dot)org> writes:
> > I forgot to ask: Does this explain why the problem occurs under 7.2.3
> > but not 7.3.2?
>
> Say again? AFAIR this issue has been with us from the beginning.
> Certainly the "regression tests fail on every DST transition day"
> syndrome has been around for as long as I've been using Postgres.

OK, I'll say again. The problem was not present on my 7.3.2 box but
was on the 7.2.3 box.

# select current_date, (current_date - 1)::date;
date | date
------------+------------
2003-04-07 | 2003-04-06
(1 row)

# select version();
version
---------------------------------------------------------------------
PostgreSQL 7.3.2 on i386-portbld-freebsd4.8, compiled by GCC 2.95.4
(1 row)

working-copy.freshports.org=#

But it WAS present on 7.2.3 earlier today. I suspect it's no longer
present, because we're now later in the day.

# select current_date, (current_date - interval '24 hours')::date;
date | date
------------+------------
2003-04-07 | 2003-04-05
(1 row)

# select current_date, (current_date - 1)::date;
date | date
------------+------------
2003-04-07 | 2003-04-06
(1 row)

# select version();
version
---------------------------------------------------------------------
PostgreSQL 7.2.3 on i386-portbld-freebsd4.6, compiled by GCC 2.95.4
(1 row)

> > Is the Right Thing To Do(tm) this:
> > select current_date, current_date-1;
> > instead of this:
> > select current_date, (current_date - interval '1 day')::date;
>
> The "current_date-1" locution is no doubt more efficient as well
> as more likely to do what you want. Still, it'd be nice if the
> other way worked.

Yes, it would be, but I'll go with what will always work. Thanks.
--
Dan Langille : http://www.langille.org/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-04-07 16:05:13 Re: possible time change issue - known problem?
Previous Message Ken Godee 2003-04-07 15:51:41 Re: chron scripts and pgsql