Re: Creating multiple Rules for on update

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Jorge Godoy <jgodoy(at)gmail(dot)com>
Cc: General PostgreSQL List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Creating multiple Rules for on update
Date: 2006-12-11 20:18:35
Message-ID: 29325.94090.qm@web31801.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tony Caduto 2006-12-11 20:23:17 Re: TOAD-like query builder for PostgreSQL?
Previous Message Jorge Godoy 2006-12-11 20:09:40 Re: Creating multiple Rules for on update