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 1kNM3k-0006Zd-Fo for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Sep 2020 20:17:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kNM3j-0002YQ-Dd for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Sep 2020 20:17:11 +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 1kNM3j-0002YI-7M for pgsql-hackers@lists.postgresql.org; Tue, 29 Sep 2020 20:17:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNM3h-00065G-2t for pgsql-hackers@lists.postgresql.org; Tue, 29 Sep 2020 20:17:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 08TKH54Z718579; Tue, 29 Sep 2020 16:17:05 -0400 From: Tom Lane To: Daniel Gustafsson cc: Masahiko Sawada , Peter Eisentraut , andrewbille@gmail.com, PostgreSQL Hackers Subject: Re: Dumping/restoring fails on inherited generated column In-reply-to: <6569EA45-268E-4635-B633-BEC5C2F73F4A@yesql.se> References: <15830.1575468847@sss.pgh.pa.us> <31905.1575491779@sss.pgh.pa.us> <24369.1580758361@sss.pgh.pa.us> <3f272982-0e0d-17a1-3fb6-fedc74197676@2ndquadrant.com> <3169466.1594841366@sss.pgh.pa.us> <660925.1601397436@sss.pgh.pa.us> <6569EA45-268E-4635-B633-BEC5C2F73F4A@yesql.se> Comments: In-reply-to Daniel Gustafsson message dated "Tue, 29 Sep 2020 22:01:09 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <718577.1601410625.1@sss.pgh.pa.us> Date: Tue, 29 Sep 2020 16:17:05 -0400 Message-ID: <718578.1601410625@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Daniel Gustafsson writes: > On 29 Sep 2020, at 18:37, Tom Lane wrote: >> This does not cause child2.f1's attislocal property to become >> true. Maybe it should have, but it's probably too late for >> that; at least, pg_dump couldn't assume it's true in older >> servers. > Do you recall the rationale for it not being set to true? I didn't spot > anything in the commit history. Intuitively it seems a tad odd. I'd bet the explanation is mostly that it didn't occur to anyone that SET DEFAULT should do that. I'm not really proposing that it should either. If we were to make any catalog changes in response to this, what I'd vote for is to add an "inherited" flag to pg_attrdef. (I'm not quite sure if a bool would be sufficient, or if we'd need to go to the same extent as pg_attribute does, and have a bool plus an inheritance count.) Of course, that line of thought does not lead to anything back-patchable. But pg_dump would have to be prepared to cope with the situation in older servers in any case. regards, tom lane