Re: multiple action rules

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: multiple action rules
Date: 2005-06-22 23:45:36
Message-ID: 1119483936.8208.25.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2005-06-22 at 18:31, Scott Marlowe wrote:
> OK, so I'm trying to make a rule with >1 action.
>
> The docs, not so helpfully, only seem to show a single action rule (at
> least in the rules section, not sure about elsewhere) The syntax
> diagram:
>
> CREATE RULE rule_name AS ON event
> TO object [WHERE rule_qualification]
> DO [INSTEAD] [action | (actions) | NOTHING];
>
> seems to imply to me that >2 actions would look like this:
>
> create rule audit_test as on delete to ntest do (
> insert into naudit(id,path) values (OLD.id, OLD.path);
> notify test;
> )
>
> But no matter what flavor of syntax I throw at this, I get:
>
> syntax error at or near "insert" at character xxx
>
> So, what's the magic pixie dust I need to sprinkle on this to make it
> work?

Never mind, I finally figured it out... About three minutes after
posting this. sheesh.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-06-23 00:06:14 Re: Setting global vars for use with triggers
Previous Message Scott Marlowe 2005-06-22 23:31:52 multiple action rules