timestamp/now in views

From: "Graeme Merrall" <gmerrall(at)email(dot)com>
To: <pgsql-sql(at)postgreSQL(dot)org>
Subject: timestamp/now in views
Date: 1999-12-08 23:18:47
Message-ID: LPBBIEJIINGFPCAOHOMCIECBCFAA.gmerrall@email.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Eisentraut 1999-12-09 00:18:44 Re: [SQL] turning a table by 90 degrees
Previous Message John C Cusick 1999-12-08 17:16:15 Re: [SQL] Getting last used oid