From: Graeme Merrall <gmerrall@email.com>
To: pgsql-sql@postgreSQL.org
Subject: timestamp/now in views
Date: Thu, 9 Dec 1999 10:18:47 +1100
Message-ID: <LPBBIEJIINGFPCAOHOMCIECBCFAA.gmerrall@email.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: gmerrall@email.com
Subject: Re: timestamp/now in views
In-Reply-To: <LPBBIEJIINGFPCAOHOMCIECBCFAA.gmerrall@email.com>
References: <LPBBIEJIINGFPCAOHOMCIECBCFAA.gmerrall@email.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox