Postgresql 7.3.2 gives the error "ON INSERT rule may not use OLD" when
trying to define the following rule:
CREATE TABLE numbers ( number INTEGER );
CREATE TABLE other_numbers ( number INTEGER );
CREATE OR REPLACE RULE number_rule AS
ON INSERT TO numbers
DO INSERT INTO other_numbers
SELECT 1 EXCEPT SELECT 2;
although the rule, even upon close inspection, seems to make no
reference at all to the OLD pseudo-relation. Given the above table
definitions, the query:
SELECT 1 EXCEPT SELECT 2;
by itself runs fine and returns 1 as expected. (We have tested this
against both the unstable Debian package for 7.3.2, and against a copy
compiled locally using the standard source archive.)
--
Brandon Craig Rhodes http://www.rhodesmill.org/brandon
Georgia Tech brandon@oit.gatech.edu