Re: Creating multiple Rules for on update - Mailing list pgsql-general

From Richard Broersma Jr
Subject Re: Creating multiple Rules for on update
Date
Msg-id 29325.94090.qm@web31801.mail.mud.yahoo.com
Whole thread Raw
In response to Re: Creating multiple Rules for on update  (Jorge Godoy <jgodoy@gmail.com>)
List pgsql-general
> When I read the docs about RULEs I remember seeing that an unqualified RULE
> was needed otherwise PG wouldn't know that the operation was complete and
> would fail. I haven't used them, but I believe that you have two options:
>   - use a RULE with your filtering conditions AND add an unqualified RULE that
>     is always run
>   - use an unqualified RULE and call a function that will perform the action
>     for you on the right tables
> I believe the second solution leads to cleaner code and is easier to update /
> debug.  But I haven't tried it...

Thanks for the Reply,
I will try creating functions called from the rule as you suggest.
I would also be enterested in hearing of any other solutions that anyone might have. Also, I am
still curious about what preresequites must be meet in order to use the WHERE predicate of a rule.

Regards,

Richard Broersma Jr.

pgsql-general by date:

Previous
From: Jorge Godoy
Date:
Subject: Re: Creating multiple Rules for on update
Next
From: Tony Caduto
Date:
Subject: Re: TOAD-like query builder for PostgreSQL?