Re: BUG #6761: unexpected behaviour of 'now'::timestamp

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #6761: unexpected behaviour of 'now'::timestamp
Дата
Msg-id 28436.1343235183@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #6761: unexpected behaviour of 'now'::timestamp  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: BUG #6761: unexpected behaviour of 'now'::timestamp  (Bert Thomas <bthomas@brothom.nl>)
Список pgsql-bugs
Pavel Stehule <pavel.stehule@gmail.com> writes:
> this is not bug - it is consequence of plan cache

FWIW, there is documentation of this issue near the end of
http://www.postgresql.org/docs/9.1/static/plpgsql-implementation.html#PLPGSQL-PLAN-CACHING

This exact case isn't covered in the examples, but the point is that the
expression 'now'::timestamp will get folded to a timestamp constant during
planning, and then not replanned later.  As Pavel says, it's a lot safer
to use one of the variants of the now() function.

            regards, tom lane

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: BUG #6761: unexpected behaviour of 'now'::timestamp
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #6758: ./configure script sets HAVE_WCSTOMBS_L 1