Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qmGU0-006LJb-Ou for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Sep 2023 16:36:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qmGTx-001nMJ-Et for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Sep 2023 16:36:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qmGTx-001nKS-3p for pgsql-hackers@lists.postgresql.org; Fri, 29 Sep 2023 16:36:49 +0000 Received: from charmander.telsasoft.com ([50.244.222.1] helo=pryzbyj2023.telsasoft) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qmGTt-008Ioy-Bx for pgsql-hackers@postgresql.org; Fri, 29 Sep 2023 16:36:48 +0000 Received: by pryzbyj2023.telsasoft (Postfix, from userid 1000) id A77C010D40; Fri, 29 Sep 2023 11:36:42 -0500 (CDT) Date: Fri, 29 Sep 2023 11:36:42 -0500 From: Justin Pryzby To: Michael Paquier Cc: Ali Akbar , Michael Paquier , Amit Langote , tushar , Tom Lane , pgsql-hackers@postgresql.org, Alvaro Herrera Subject: Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL Message-ID: References: <217ddce6-1b0f-509d-f8e0-5ddd9cad5d86@lab.ntt.co.jp> <107ccc78-1a10-ff59-e837-e5c99dc8c152@lab.ntt.co.jp> <20171214054902.GC23527@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Sep 29, 2023 at 09:16:35AM +0900, Michael Paquier wrote: > You mean when upgrading from an instance of 9.6 or older as c30f177 is > not there, right? No - while upgrading from v15 to v16. I'm not clear on how we upgraded *to* v15 without hitting the issue, nor how the "not null" got dropped... > Anyway, it seems like the patch from [1] has no need to run this check > when the old cluster's version is 10 or newer. And perhaps it should > mention that this check could be removed from pg_upgrade once v10 > support is out of scope, in the shape of a comment. You're still thinking of PRIMARY KEY as the only way to hit this, right? But Ali Akbar already pointed out how to reproduce the problem with DROP NOT NULL - which still applies to both v16 and v17.