Re: Rule/currval() issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tim Perdue <tim(at)perdue(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Rule/currval() issue
Date: 2001-03-14 18:30:55
Message-ID: 28457.984594655@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tim Perdue <tim(at)perdue(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Creager, Robert S 2001-03-14 18:41:33 RE: Rule/currval() issue
Previous Message Tim Perdue 2001-03-14 18:13:35 Re: Rule/currval() issue