Re: Rule/currval() issue - Mailing list pgsql-sql

From Tom Lane
Subject Re: Rule/currval() issue
Date
Msg-id 28457.984594655@sss.pgh.pa.us
Whole thread Raw
In response to Re: Rule/currval() issue  (Tim Perdue <tim@perdue.net>)
List pgsql-sql
Tim Perdue <tim@perdue.net> writes:
>> You probably should be using a trigger, not a rule at all.

> OK - so another rule like this one, is probably ill-advised as well? It seems
> a lot easier than going into the triggers:

> CREATE RULE forum_delete_agg AS
>     ON DELETE TO forum
>     DO UPDATE forum_agg_msg_count SET count=count-1
>         WHERE group_forum_id=old.group_forum_id;

That seems OK offhand, although it's hard to guess whether it will be
more or less efficient than a trigger.
        regards, tom lane


pgsql-sql by date:

Previous
From: Tim Perdue
Date:
Subject: Re: Rule/currval() issue
Next
From: "Creager, Robert S"
Date:
Subject: RE: Rule/currval() issue