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

Re: bug? rules fail to cascade after NOT IN

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brandon Craig Rhodes <brandon(at)oit(dot)gatech(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: bug? rules fail to cascade after NOT IN
Date: 2003-03-04 02:00:28
Message-ID: 19486.1046743228@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Brandon Craig Rhodes <brandon(at)oit(dot)gatech(dot)edu> writes:
> The `working' test case omits the
>     AND (account, policy) NOT IN
>      (SELECT account, policy FROM policy_accounts_active)
> condition from the end of executor_active, which magically makes the
> executor_hamlet rule start firing as it should.

I don't think this is a bug.  The executor_hamlet rule fires after the
executor_active rule does; therefore the (account, policy) pair *has
already been inserted into policy_accounts_active*, and will be found
when executor_hamlet re-executes the select to look for it.

My advice to you is to use triggers, not rules, for pushing data from
one table to another; especially when you need logic this complex to
decide what to do.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Brandon Craig RhodesDate: 2003-03-04 03:23:43
Subject: Re: bug? rules fail to cascade after NOT IN
Previous:From: Christopher Kings-LynneDate: 2003-03-04 01:49:59
Subject: Re: problem importing languages in CVS tip

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