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

Re: BUG #4271: dropped columns conflict with returning rules

From: "Alexey Bashtanov" <bashtanov(at)imap(dot)cc>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4271: dropped columns conflict with returning rules
Date: 2008-06-29 16:25:06
Message-ID: 1214756706.10586.1260956173@webmail.messagingengine.com (view raw or flat)
Thread:
Lists: 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


In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2008-06-29 16:38:33
Subject: Re: BUG #4271: dropped columns conflict with returning rules
Previous:From: eric melbardisDate: 2008-06-29 16:21:56
Subject: BUG #4274: uuid returns duplicate values

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