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