Re: Inconsistent values for 'now'

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Inconsistent values for 'now'
Дата
Msg-id 2955.1112330449@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Inconsistent values for 'now'  (Glen Eustace <geustace@godzone.net.nz>)
Ответы Re: Inconsistent values for 'now'  (Glen Eustace <geustace@godzone.net.nz>)
Список pgsql-general
Glen Eustace <geustace@godzone.net.nz> writes:
> The view is defined to be;

> CREATE VIEW domain_registry AS
>    SELECT *
>       FROM domain_registry_history
>       WHERE tstamp > 'now';

Offhand I'd expect the 'now' to be reduced to a timestamp constant
at the time the view is created.

Perhaps you were expecting something like

CREATE VIEW domain_registry AS
   SELECT *
      FROM domain_registry_history
      WHERE tstamp > now();

although personally I'd not feel very comfortable with the idea of a
view whose contents change over time even when you weren't actually
doing anything to the database.  Maybe you should rethink this idea
altogether...

            regards, tom lane

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

Предыдущее
От: "Zitan Broth"
Дата:
Сообщение: SELECT INTO Array?
Следующее
От: Glen Eustace
Дата:
Сообщение: Re: Inconsistent values for 'now'