Rules and Views - Mailing list pgsql-hackers

From Curt Sampson
Subject Rules and Views
Date
Msg-id Pine.NEB.4.44.0207311132230.493-100000@angelic.cynic.net
Whole thread Raw
Responses Re: Rules and Views  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I'm having a weird problem on my " PostgreSQL 7.2.1 on i386--netbsdelf,
compiled by GCC 2.95.3" system. Executing these commands:

CREATE TABLE test_one (id int PRIMARY KEY, value_one text);
CREATE TABLE test_two (id int PRIMARY KEY, value_two text);
CREATE VIEW test AS   SELECT test_one.id, value_one, value_two   FROM test_one   JOIN test_two USING (id);
CREATE RULE test_insert AS   ON INSERT TO test   DO (INSERT INTO test_one (id, value_one) VALUES (NEW.id,
NEW.value_one);INSERTINTO test_two (id, value_two) VALUES (NEW.id, NEW.value_two););
 
INSERT INTO test VALUES (1, 'one', 'onemore');

returns "ERROR:  Cannot insert into a view without an appropriate rule"
for that last statement. The rule does show up in pg_rules, though.

What am I doing wrong here? Is there a bug?

cjs
-- 
Curt Sampson  <cjs@cynic.net>   +81 90 7737 2974   http://www.netbsd.org   Don't you know, in this new Dark Age, we're
alllight.  --XTC
 



pgsql-hackers by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: Re: [GENERAL] Stats Collector
Next
From: Dave Cramer
Date:
Subject: Re: Virus Emails