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

Re: [GENERAL] INSTEAD rule bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitry Tkach <dmitry(at)openratings(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] INSTEAD rule bug?
Date: 2003-07-15 21:42:22
Message-ID: 9240.1058305342@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-general
Dmitry Tkach <dmitry(at)openratings(dot)com> writes:
> Sure, but it is inside the rule that has 'where x is not null and y is 
> not null' on it as a qualifier, so
> with my test example it should just never get executed in the first place.

You're confusing rules with triggers.  The INSERT *will* get executed;
the rule's qualifier gets moved to the WHERE of the INSERT...SELECT,
and the way you get no effect is for the qual to fail on every row the
SELECT generates.

One way to think about the problem (though I'm not sure this is right in
detail) is that there's no place to hang a top-level WHERE on a UNION.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Dmitry TkachDate: 2003-07-15 21:53:13
Subject: Re: [GENERAL] INSTEAD rule bug?
Previous:From: Dmitry TkachDate: 2003-07-15 21:28:54
Subject: Re: [GENERAL] INSTEAD rule bug?

pgsql-general by date

Next:From: Dmitry TkachDate: 2003-07-15 21:53:13
Subject: Re: [GENERAL] INSTEAD rule bug?
Previous:From: Derek HamiltonDate: 2003-07-15 21:32:40
Subject: Re: Firebird vrs Postgresql

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