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

BUG #7583: Problem using INHERITS and LIKE

From: bryan(dot)love(at)iovation(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #7583: Problem using INHERITS and LIKE
Date: 2012-10-03 20:36:43
Message-ID: E1TJVgR-0003GE-Rs@wrigleys.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged on the website:

Bug reference:      7583
Logged by:          Bryan Love
Email address:      bryan(dot)love(at)iovation(dot)com
PostgreSQL version: 9.2.1
Operating system:   Centos 6
Description:        

After creating a table using LIKE and INHERITS, if you drop a column from
the parent table that existed prior to creation of the child table, the
column will not be dropped from the child table.

Test Case:

=# create table foo(col1 int, col2 int);
=# create table bar (like foo) inherits (foo);
NOTICE:  merging column "col1" with inherited definition
NOTICE:  merging column "col2" with inherited definition
CREATE TABLE
=# alter table foo drop col1;
ALTER TABLE
=# \d bar
      Table "public.bar"
 Column |  Type   | Modifiers
--------+---------+-----------
 col1   | integer |
 col2   | integer |
Inherits: foo

--- copy/paste block commands ----
drop table bar;
drop table foo;
create table foo(col1 int, col2 int);
create table bar (like foo) inherits (foo);
alter table foo drop col1;
\d bar



Responses

pgsql-bugs by date

Next:From: Maxim BogukDate: 2012-10-04 00:40:19
Subject: Re: BUG #7573: data loss in corner case using delete_old_cluster.sh (pg_upgrade)
Previous:From: Tom LaneDate: 2012-10-03 17:58:59
Subject: Re: RE:Re: BUG #7556 addition info

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