From: Herouth Maoz <herouth@oumail.openu.ac.il>
To: Michael Olivier <mo@local2me.com>
To: pgsql-sql@postgreSQL.org <pgsql-sql@postgreSQL.org>
Subject: Re: [SQL] few questions about rules: timestamp, new.oid
Date: Tue, 3 Aug 1999 13:32:14 +0300
Message-ID: <l03130302b3cc756bcae7@[147.233.159.109]> (raw)
In-Reply-To: <37A607FA.E9727ABD@local2me.com>
At 00:04 +0300 on 03/08/1999, Michael Olivier wrote:
> 1. I'm storing a datetime timestamp for when the change was entered into
> my changes table, but the timestamp doesn't change with subsequent
> tests:
>
> create rule users_modify_rule as on update to users do
> insert into changes (table_name, change_time, ref_oid, type)
> values ('users', 'now', current.oid, 'update');
Better use a function than a constant - try now() instead. A constant
usually gets interpreted at the time of creation. A function remains to be
interpreted at the time of use.
Herouth
--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma
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: herouth@oumail.openu.ac.il, mo@local2me.com
Subject: Re: [SQL] few questions about rules: timestamp, new.oid
In-Reply-To: <l03130302b3cc756bcae7@[147.233.159.109]>
References: <37A607FA.E9727ABD@local2me.com> <l03130302b3cc756bcae7@[147.233.159.109]>
* 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