Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TJmZU-0002e0-So for pgsql-bugs@postgresql.org; Thu, 04 Oct 2012 14:38:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TJmZR-0003C7-Lq for pgsql-bugs@postgresql.org; Thu, 04 Oct 2012 14:38:40 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q94EcZjb025219; Thu, 4 Oct 2012 10:38:35 -0400 (EDT) From: Tom Lane To: bryan.love@iovation.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7583: Problem using INHERITS and LIKE In-reply-to: References: Comments: In-reply-to bryan.love@iovation.com message dated "Wed, 03 Oct 2012 20:36:43 -0000" Date: Thu, 04 Oct 2012 10:38:35 -0400 Message-ID: <25218.1349361515@sss.pgh.pa.us> X-Pg-Spam-Score: -4.0 (----) X-Archive-Number: 201210/36 X-Sequence-Number: 34336 bryan.love@iovation.com writes: > 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. This is not a bug. LIKE says the column isn't inherited, so it exists in the child independently of whether it exists in the parent. Or, if you want to add it up: the child starts out with one local definition of the column (from LIKE) and one inherited (from INHERITS). Dropping the column from the parent removes the latter, but you still have the former, so the column stays. > =# create table bar (like foo) inherits (foo); Just out of curiosity, is there any actual use-case for such a silly thing? regards, tom lane