Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hftKF-0004H0-GR for pgsql-bugs@arkaria.postgresql.org; Tue, 25 Jun 2019 21:50:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hftKE-0002uF-2P for pgsql-bugs@arkaria.postgresql.org; Tue, 25 Jun 2019 21:50:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hftKD-0002tx-Q7 for pgsql-bugs@lists.postgresql.org; Tue, 25 Jun 2019 21:50:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hftKB-00085h-P1 for pgsql-bugs@lists.postgresql.org; Tue, 25 Jun 2019 21:50:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x5PLnuCJ028918; Tue, 25 Jun 2019 17:49:56 -0400 From: Tom Lane To: dwilches@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15873: Attaching a partition fails because it sees deleted columns In-reply-to: <15873-8c61945d6b3ef87c@postgresql.org> References: <15873-8c61945d6b3ef87c@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 25 Jun 2019 21:30:44 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28916.1561499396.1@sss.pgh.pa.us> Date: Tue, 25 Jun 2019 17:49:56 -0400 Message-ID: <28917.1561499396@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > Bug reference: 15873 > PostgreSQL version: 11.2 > I'm trying to attach a partition to one of my partitioned tables and I'm > getting an error: > ERROR: 42703: attribute 4 of type my_table_000000_partition has been > dropped FWIW, I tried to reproduce this using the attached example. Works fine here. However, this report sounds quite a lot like some partitioning bugs that have been fixed in the past. Could you update to 11.4 and try again? If it still fails, then there's some aspect of your problem table that you have not told us about. regards, tom lane drop table if exists pparent; create table pparent(f1 int, z int, f2 int, my_timestamp timestamptz, f3 int) partition by range (my_timestamp); alter table pparent drop column z; create table defchild (f1 int, f2 int, bogus1 text, my_timestamp timestamptz, bogus2 text, f3 int); alter table defchild drop column bogus1, drop column bogus2; alter table pparent attach partition defchild default; create table otherchild (like defchild including all); alter table pparent attach partition otherchild for values from ('2019-01-01') to ('2020-01-01');