Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB1FLXF95648 for ; Fri, 1 Dec 2000 10:21:33 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id eB1FLiY03031; Fri, 1 Dec 2000 10:21:44 -0500 (EST) To: "A. Van Hook" cc: pgsql-sql@postgresql.org Subject: Re: arhiving rule In-reply-to: <200012011145.eB1BjEF83961@mail.postgresql.org> References: <200012011145.eB1BjEF83961@mail.postgresql.org> Comments: In-reply-to "A. Van Hook" message dated "Fri, 01 Dec 2000 11:44:29 +0000" Date: Fri, 01 Dec 2000 10:21:44 -0500 Message-ID: <3028.975684104@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200012/5 X-Sequence-Number: 336 "A. Van Hook" 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