Re: [BUGS] INSTEAD rule bug? - Mailing list pgsql-general

From Tom Lane
Subject Re: [BUGS] INSTEAD rule bug?
Date
Msg-id 8750.1058302715@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] INSTEAD rule bug?  (Dmitry Tkach <dmitry@openratings.com>)
Responses Re: [BUGS] INSTEAD rule bug?  (Dmitry Tkach <dmitry@openratings.com>)
List pgsql-general
Dmitry Tkach <dmitry@openratings.com> writes:
> create rule insert_test as on insert to test_view where new.x is not
> null and new.y is not null do instead
> (
>    insert into test
>    select new.* union
>    select new.*;
> );

Mmm.  In CVS tip that throws

ERROR:  UNION/INTERSECT/EXCEPT member statement may not refer to other relations of same query level

which was a check added as a result of this discussion thread:
http://archives.postgresql.org/pgsql-general/2003-02/msg00693.php

I am sure you are running into some misbehavior associated with the
fact that the rule transformation generates a bogusly-structured SQL
query, and 7.2 isn't noticing.

I'd like to support this case someday, but it's not clear how...

            regards, tom lane

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: selects during vacuum
Next
From: "Dann Corbit"
Date:
Subject: Re: Firebird vrs Postgresql