Skip site navigation (1) Skip section navigation (2)

BUG #4434: Error inserting into view - unrecognized node type: 313

From: "Dean Rasheed" <dean_rasheed(at)hotmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4434: Error inserting into view - unrecognized node type: 313
Date: 2008-09-23 14:31:14
Message-ID: 200809231431.m8NEVEU5053058@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      4434
Logged by:          Dean Rasheed
Email address:      dean_rasheed(at)hotmail(dot)com
PostgreSQL version: 8.3
Operating system:   SuSE 10.3 64-bit
Description:        Error inserting into view - unrecognized node type: 313
Details: 

I'm getting an error when trying to insert into a view, using a
rule. As far as I can work out, it only errors if my insert statement
tries to insert multiple rows, and any of the rows contains a
sub-query. Here is a simple made-up example:

DROP TABLE IF EXISTS foo CASCADE;
CREATE TABLE foo(a int, b int);
CREATE VIEW foo_v AS SELECT * FROM foo;
CREATE RULE foo_r AS ON INSERT TO foo_v DO INSTEAD INSERT INTO foo
VALUES(NEW.a, NEW.b);
INSERT INTO foo_v VALUES ((SELECT 1), (SELECT 2)), ((SELECT 3), (SELECT
4));

ERROR:  unrecognized node type: 313

Inserting the rows one at a time works OK, as does inserting into a
table, or inserting both rows together but without using sub-queries.

I've tested this with 8.3 and a fairly recent CVS version.

Dean.

Responses

pgsql-bugs by date

Next:From: Hal BlackDate: 2008-09-23 17:30:24
Subject: BUG #4435: pg_ctl start doesn't detach when run via SSH
Previous:From: Craig RingerDate: 2008-09-23 10:50:49
Subject: Re: BUG #4433: entries like "host all all 10.0.50.31/0 ..." should not be allowed or trigger a warning

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group