timestamp/now in views

Поиск
Список
Период
Сортировка
От Graeme Merrall
Тема timestamp/now in views
Дата
Msg-id LPBBIEJIINGFPCAOHOMCIECBCFAA.gmerrall@email.com
обсуждение исходный текст
Ответы Re: [SQL] timestamp/now in views  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [SQL] timestamp/now in views  (wieck@debis.com (Jan Wieck))
Список pgsql-sql
Sorry for being an idiot but I saw something similar to this in the docs but
haven't been able to find it since.
I tried creating a view using the following syntax
CREATE VIEW prev_day AS SELECT * FROM audit WHERE audit_datetime >
(current_timestamp - interval'24 hours');

Now as some of you will pick up, this creates a view with the current
timestamp set to the creation time of the view, not the actual time the view
was executed.
I hacked around with various combos of quote marks and tried now() and so
on, but to no avail.

Can someone enlighten me?

Cheers,Graeme



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

Предыдущее
От: John C Cusick
Дата:
Сообщение: Re: [SQL] Getting last used oid
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [SQL] turning a table by 90 degrees