From: Tom Lane <tgl@sss.pgh.pa.us>
To: A. Van Hook <hook@kcp.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: arhiving rule
Date: Fri, 01 Dec 2000 10:21:44 -0500
Message-ID: <3028.975684104@sss.pgh.pa.us> (raw)
In-Reply-To: <200012011145.eB1BjEF83961@mail.postgresql.org>
References: <200012011145.eB1BjEF83961@mail.postgresql.org>
"A. Van Hook" <hook@kcp.com> writes:
> I have, what I think is a simple rule to arrive transactions:
> create rule usageupdt as on update to usage
> do insert into usageHistory
> (lkey, jan, feb, mar, bowner, penalty, prepay, bal, notes,
> change)
> values
> (new.lkey, old.jan, old.feb, old.mar, old.bowner,
> old.penalty, old.prepay, old.bal, old.notes, 'now')
> the only problem is that once is rule is created, new rows in the
> archive table all have the same date!
> -the date when the rule was created....
Try now() instead of 'now'. The latter is coerced to a timestamp
constant as soon as the rule is parsed ...
regards, tom lane
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: tgl@sss.pgh.pa.us, hook@kcp.com
Subject: Re: arhiving rule
In-Reply-To: <3028.975684104@sss.pgh.pa.us>
References: <200012011145.eB1BjEF83961@mail.postgresql.org> <3028.975684104@sss.pgh.pa.us>
* 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