Re: possible time change issue - known problem?

Поиск
Список
Период
Сортировка
От Dan Langille
Тема Re: possible time change issue - known problem?
Дата
Msg-id 3E916788.14623.AB57E7C@localhost
обсуждение исходный текст
Ответ на Re: possible time change issue - known problem?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: possible time change issue - known problem?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On 7 Apr 2003 at 11:37, Tom Lane wrote:

> "Dan Langille" <dan@langille.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/


В списке pgsql-general по дате отправления:

Предыдущее
От: "Ken Godee"
Дата:
Сообщение: Re: chron scripts and pgsql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: possible time change issue - known problem?