Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldu7v-0004IM-DW for pgsql-bugs@arkaria.postgresql.org; Tue, 04 May 2021 12:26:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ldu7u-0004lw-AI for pgsql-bugs@arkaria.postgresql.org; Tue, 04 May 2021 12:26:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldu7t-0004lo-E7 for pgsql-bugs@lists.postgresql.org; Tue, 04 May 2021 12:26:10 +0000 Received: from forward4-smtp.messagingengine.com ([66.111.4.238]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldu7p-0002Jz-5M for pgsql-bugs@lists.postgresql.org; Tue, 04 May 2021 12:26:09 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailforward.nyi.internal (Postfix) with ESMTP id CB6B319411FE; Tue, 4 May 2021 08:26:01 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 04 May 2021 08:26:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=U0fJsJu0GM9Q/s+G3R337so+uWTHrPfJ9251fQt+T So=; b=ftw5ahyKmeFqoeW3Xf82GVXGmktacPJ04YFUhmT2vp1CglVQL1YaOXhIV lESKb+EfFXooES0LyuOSzMTApDIyQCXHviLhzEsAWkg+RtHFpxrYKVuqhOeuZNSN ER1x3GmX/av6u3ZAIMybobvcijQWKSpkBB1LpXKR7ZiOgFb9gx/BPE+Qoui7NzAJ N1GqZzefTx0pvJmvQQxMw/1BMZlSTqG+Gd7bdlHeeyFMgJi1hmqm/OEXrypHJxgl E6y/5FTdfwAdBaj5njCeCzOJdpecWQqLDqdl2k4WkiH6/ENWpDwMjWQFWwxA/pUf vJaRN3LIvLDpQG3/HvQXEsDsKNPjA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdefiedgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffhvfhfkffffgggjggtgfesthekredttdefheenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvg hrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhepveejueejteevteffudev ffdtveekvefhjeetudegieefudevtefhleelteejkeegnecuffhomhgrihhnpehpohhsth hgrhgvshhqlhdrohhrghenucfkphepledurddugedrvddvgedruddvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvg hnthhrrghuthesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: from laptop206oxuk.local (p5b0ee078.dip0.t-ipconnect.de [91.14.224.120]) by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 May 2021 08:26:00 -0400 (EDT) Subject: Re: pg_restore - generated column - not populating From: Peter Eisentraut To: Tom Lane , Santosh Udupi Cc: Adrian Klaver , pgsql-bugs@lists.postgresql.org References: <9881df8c-f88e-977e-f222-adb04ba1ec80@aklaver.com> <89a62c70-4386-a3ef-f2ea-5e0f448cef11@aklaver.com> <0275a27c-2447-f8e5-489b-d7e419997299@aklaver.com> <3874667.1614101644@sss.pgh.pa.us> <3877970.1614105611@sss.pgh.pa.us> <4007188.1614128586@sss.pgh.pa.us> Message-ID: Date: Tue, 4 May 2021 14:25:58 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 26.04.21 15:40, Peter Eisentraut wrote: >> I suspect this example is revealing bugs in both the backend >> (ATTACH PARTITION ought to take care of this, no?) and pg_dump >> (the backend can't be blamed for pg_dump's choices of columns >> to dump).  Peter? > > The backend side of this would be fixed by the proposed > > (it's the same code for ALTER TABLE ... INHERIT and ATTACH PARTITION). > > The pg_dump side can apparently be fixed by adding > > diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c > index 1a261a5545..c210883ca3 100644 > --- a/src/bin/pg_dump/common.c > +++ b/src/bin/pg_dump/common.c > @@ -585,7 +585,7 @@ flagInhAttrs(DumpOptions *dopt, TableInfo *tblinfo, > int numTables) >            } > >            /* Remove generation expression from child */ > -           if (foundGenerated && !dopt->binary_upgrade) > +           if (foundGenerated && !dopt->binary_upgrade && > !tbinfo->ispartition) >                tbinfo->attrdefs[j] = NULL; >        } >    } > > Looks like this was accidentally broken by the last minor release's > fixes in this area. Both of these issues have been fixed and will be in the next minor releases.