INSTEAD rule bug? - Mailing list pgsql-general

From Dmitry Tkach
Subject INSTEAD rule bug?
Date
Msg-id 3F1428AE.3090709@openratings.com
Whole thread Raw
Responses Re: [BUGS] INSTEAD rule bug?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Here is a problem a ran into:

testdb=# create table test (x int);
CREATE TABLE
testdb=# create table test_view as select * from test;
SELECT
testdb=# create rule insert_test as on insert to test_view do instead
insert into test values (new.*);
CREATE RULE
testdb=# create rule skip_test as on insert to test_view where x is null
do instead nothing;
CREATE RULE
testdb=# insert into test_view values (null);
INSERT 17259 1
testdb=# select * from test;
 x
---

(1 row)

According to the last rule the insert should not have happened, right?
How come it got ignored?

Thanks!

Dima



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Billions of records?
Next
From: Jonathan Bartlett
Date:
Subject: Re: Query Optimisation