Re: currval = currval+1 - Mailing list pgsql-general

From Merlin Moncure
Subject Re: currval = currval+1
Date
Msg-id BANLkTi=FRg-sWLzLnKJH2eR=vD8hk4L64w@mail.gmail.com
Whole thread Raw
In response to Re: currval = currval+1  (salah jubeh <s_jubeh@yahoo.com>)
List pgsql-general
On Wed, Jun 1, 2011 at 10:22 AM, salah jubeh <s_jubeh@yahoo.com> wrote:
> I have some rules on the table and I have dropped them and everything went
> fine. the rule is as follow
>
> CREATE OR REPLACE RULE status_change_ins AS
>     ON INSERT TO account  DO  INSERT INTO account_status_change_log
> (account_id, account_status_id, status_change_date)
>   VALUES (new.account_id, new.account_status_id, now());
>
> I do not know what is happing here, but this is a strange behavior.

'rules suck' is the problem :(.  uncontrollable re-execution of
volatile functions is just *one* issue with them. good news: 9.1
completely fixes this with view update triggers. In the meantime,
consider dropping the update rule and making a functions which does
the delete and updates the log, or doing it in the client.

merlin

pgsql-general by date:

Previous
From: salah jubeh
Date:
Subject: Re: currval = currval+1
Next
From: Tom Lane
Date:
Subject: Re: currval = currval+1