Re: BUG #4271: dropped columns conflict with returning rules - Mailing list pgsql-bugs

From Alexey Bashtanov
Subject Re: BUG #4271: dropped columns conflict with returning rules
Date
Msg-id 1214756706.10586.1260956173@webmail.messagingengine.com
Whole thread Raw
In response to Re: BUG #4271: dropped columns conflict with returning rules  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Hello, Tom!

> What did you do *exactly*?

Here's the example of command sequence that lead to this error:

luh=# create table foo(a int);
CREATE TABLE
luh=# alter TABLE foo add column b int;
ALTER TABLE
luh=# alter TABLE foo drop column b;
ALTER TABLE
luh=# alter TABLE foo add column c int;
ALTER TABLE
luh=# create table foo_child() inherits (foo);
CREATE TABLE
luh=# create or replace rule myrule as on insert to foo do instead
insert into foo_child values(new.*) returning foo_child.*;
ERROR:  cannot convert relation containing dropped columns to view
luh=#

> > this rule started to work incorrectly: it did not store foo and quackquack
> > values but used nulls instead.
>
> This is expected behavior because the * expressions are expanded when
> the rule is defined:

That's OK

Thanks,
 Alexey

--
http://www.fastmail.fm - The way an email service should be

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #4271: dropped columns conflict with returning rules
Next
From: "Hiroshi Saito"
Date:
Subject: Re: BUG #4274: uuid returns duplicate values