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

BUG #4271: dropped columns conflict with returning rules

From: "Alexey Bashtanov" <bashtanov(at)imap(dot)cc>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4271: dropped columns conflict with returning rules
Date: 2008-06-29 02:07:50
Message-ID: 200806290207.m5T27oxi034909@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      4271
Logged by:          Alexey Bashtanov
Email address:      bashtanov(at)imap(dot)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'

Responses

pgsql-bugs by date

Next:From: y.y.chenDate: 2008-06-29 02:21:00
Subject: BUG #4272: No password can CREATE & DROP database!!
Previous:From: Dave PageDate: 2008-06-28 13:21:18
Subject: Re: BUG #4267: initdb fails

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