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

From Alexey Bashtanov
Subject BUG #4271: dropped columns conflict with returning rules
Date
Msg-id 200806290207.m5T27oxi034909@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #4271: dropped columns conflict with returning rules
List pgsql-bugs
The following bug has been logged online:

Bug reference:      4271
Logged by:          Alexey Bashtanov
Email address:      bashtanov@imap.cc
PostgreSQL version: 8.3.1
Operating system:   linux
Description:        dropped columns conflict with returning rules
Details:

I have created a partitioned table cache with partitions cache_id_g_4184088
and cache_id_le_4184088 those inherit cache.
I provided insert by the following rule:
CREATE RULE cache_partic AS ON INSERT TO cache DO INSTEAD INSERT INTO
cache_id_g_4184088 VALUES (new.*) RETURNING cache_id_g_4184088.*;

after I ran
ALTER TABLE cache add column foo
ALTER TABLE cache add column bar
ALTER TABLE cache drop column bar
ALTER TABLE cache add column quackquack

this rule started to work incorrectly: it did not store foo and quackquack
values but used nulls instead.

When I tried to ReCREATE this rule, POSTGRESQL said 'ERROR:  cannot convert
relation containing dropped columns to view'

pgsql-bugs by date:

Previous
From: "Dave Page"
Date:
Subject: Re: BUG #4267: initdb fails
Next
From: "y.y.chen"
Date:
Subject: BUG #4272: No password can CREATE & DROP database!!