From: | Curt Sampson <cjs(at)cynic(dot)net> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Rules and Views |
Date: | 2002-07-31 02:34:20 |
Message-ID: | Pine.NEB.4.44.0207311132230.493-100000@angelic.cynic.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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);
INSERT INTO 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(at)cynic(dot)net> +81 90 7737 2974 http://www.netbsd.org
Don't you know, in this new Dark Age, we're all light. --XTC
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2002-07-31 02:43:07 | Re: getpid() function |
Previous Message | Christopher Kings-Lynne | 2002-07-31 02:32:31 | Re: [GENERAL] Stats Collector |