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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-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

Browse pgsql-bugs by date

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

Browse pgsql-general by date

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