Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TJVgX-00059Q-Dg for pgsql-bugs@postgresql.org; Wed, 03 Oct 2012 20:36:49 +0000 Received: from mahout.postgresql.org ([98.129.198.123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TJVgU-0004ZW-B5 for pgsql-bugs@postgresql.org; Wed, 03 Oct 2012 20:36:49 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TJVgS-0003Ku-EK for pgsql-bugs@postgresql.org; Wed, 03 Oct 2012 20:36:45 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1TJVgR-0003GE-Rs for pgsql-bugs@postgresql.org; Wed, 03 Oct 2012 20:36:43 +0000 Date: Wed, 03 Oct 2012 20:36:43 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #7583: Problem using INHERITS and LIKE To: pgsql-bugs@postgresql.org From: bryan.love@iovation.com X-Pg-Spam-Score: -4.0 (----) X-Archive-Number: 201210/35 X-Sequence-Number: 34335 The following bug has been logged on the website: Bug reference: 7583 Logged by: Bryan Love Email address: bryan.love@iovation.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: =3D# create table foo(col1 int, col2 int); =3D# create table bar (like foo) inherits (foo); NOTICE: merging column "col1" with inherited definition NOTICE: merging column "col2" with inherited definition CREATE TABLE =3D# alter table foo drop col1; ALTER TABLE =3D# \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