Skip site navigation (1) Skip section navigation (2)

Re: DO INSTEAD and conditional rules

From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>,david(at)kineticode(dot)com, Jan Wieck <JanWieck(at)yahoo(dot)com>
Subject: Re: DO INSTEAD and conditional rules
Date: 2005-04-26 06:10:39
Message-ID: 426DDB5F.30101@samurai.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Tom Lane wrote:
> DO INSTEAD means that the *original* query will not execute; it does
> not suppress actions produced by other rules.  If we did not define
> it that way, I think your example would have to error out --- how
> would you choose which INSTEAD rule wins?

I think DO INSTEAD should control whether the original query is added to 
the set of query trees produced by the rule. Since we apply rules in 
alphabetical order, I would expect the first rule's conditional to be 
checked; when it matches, we would apply the rule and replace the 
original query with the rule's action (since it is DO INSTEAD). We would 
then apply rules to the result of the first rule; since no more rules 
can be applied, the resulting query would be the result of the first rule.

-Neil

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-04-26 06:37:14
Subject: Re: DO INSTEAD and conditional rules
Previous:From: David WheelerDate: 2005-04-26 06:05:56
Subject: Re: DO INSTEAD and conditional rules

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group