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 1uXk4R-00Dp2U-55 for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Jul 2025 17:19:31 +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 1uXk4P-002CRA-7a for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Jul 2025 17:19:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uXk4O-002CQr-Rv for pgsql-hackers@lists.postgresql.org; Fri, 04 Jul 2025 17:19:29 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uXk4N-005Zzc-0T for pgsql-hackers@postgresql.org; Fri, 04 Jul 2025 17:19:28 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 80131140020E; Fri, 4 Jul 2025 13:19:26 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Fri, 04 Jul 2025 13:19:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1751649566; x=1751735966; bh=i oDZki+j+6rRLZoCObq5DtztxEx6eQ6lTs5WkB0AKKE=; b=Z4yaGYpv82g7w7jd0 zeEXUORt4Oy4IBoO4PSj7Nj/kIVJDU9DV9vaS2wYUQ0n4qdiSThJ5f4YogqS60Eq 3MMQ1ltMceQpvSumjSRPIQZuA9n903LgmY4xoPpKGZzw6HwFRfNNfFD3E+P5W3Cf iC+Rxl4cbxU6wko1UaTFFc/m/er5kgZ3ctTdrVknU3X7Bh3ryPTeVidEiI0dyoS1 SX6FYILL9qmq7fK4y93PNkQZp8TpjTsMaxcmvrZQLrLbbumfUqP+x2H+XcT1qyAg HlA9twiyMhe1unAvR7eD8zCZESpSmblGhsihzxmfR7bYDrAJgjiJozmSErvJAzYb sCBNg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddvfeejgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfggtggugfgjsehmkeerredttdejnecuhfhrohhmpeetlhhvrghrohcu jfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqeenuc ggtffrrghtthgvrhhnpeduleekkefgtddttedtkefguddvieffleetgeejiefhteehkeev feettdduvdfhueenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghr rhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspghrtghpthhtohepkedpmhhouggvpe hsmhhtphhouhhtpdhrtghpthhtohepthhushhhrghrrdgrhhhujhgrsegvnhhtvghrphhr ihhsvggusgdrtghomhdprhgtphhtthhopehmihgthhgrvghlrdhprghquhhivghrsehgmh grihhlrdgtohhmpdhrtghpthhtohepthhhvgdrrghprggrnhesghhmrghilhdrtghomhdp rhgtphhtthhopehrmhhtsehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtph htthhopehmihgthhgrvghlsehprghquhhivghrrdighiiipdhrtghpthhtohepphhgshhq lhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepthhglh esshhsshdrphhghhdrphgrrdhushdprhgtphhtthhopehprhihiigshiesthgvlhhsrghs ohhfthdrtghomh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 4 Jul 2025 13:19:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1751649563; bh=9Hu6w5ClzawwvSKXH7lDlWoTDtwsSNGdfXHEglrM6js=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=AhuYQtf6XM/38omIsuiusR9qzuMS758GURQhAPY35dCVfQwZr/mm3Nqti7xXguX2v 43YjXPqFLt19bv9mDAekNtYYenF/8qQ7CW/xIZNLvMrZSFuT04DENHChfcbfzKuoJJ jo6bi5iXl3SQCXdQAhhz+zKtT1t/sSstivdLd3NfsAk9Hg0bYIIkSwjOQw+I2CKYYt nW3i4aEnxLGW7S5XKoAJmj9NNqIHy6jjxqRmTV0xLMlp9CL9Fa5IR2ihiFXyHNjlvm 5liD7K42RlxNyTCMFTMNG4PhWKgQsTDS2nZ++RmMh/wRJcF+RLAUfjl8MM3xLWxxxC n1t68NkGWttcA== Received: by schmee.kurilemu.local (Postfix, from userid 1000) id A69B690; Fri, 4 Jul 2025 19:19:23 +0200 (CEST) Date: Fri, 4 Jul 2025 19:19:23 +0200 From: Alvaro Herrera To: Tom Lane Cc: Justin Pryzby , Michael Paquier , Ali Akbar , Michael Paquier , tushar , pgsql-hackers@postgresql.org, rmt@lists.postgresql.org Subject: Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL Message-ID: <202507041719.l5qh2rme2bbx@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ygvjcb67ii7yk42r" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202507041645.afjl5rssvrgu@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ygvjcb67ii7yk42r Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2025-Jul-04, Alvaro Herrera wrote: > Hmm, crake doesn't like the fact that there's no regnamespace in 9.4. > Apparently in version 13 we claim to support back to 9.0. I only tried > with an old server version 12. Should be an easy fix ... It goes like this. It's tested with 9.2 only though, as 9.1 doesn't compile from Git (lack of Flex) and I didn't want to try a tarball. (This is for master. 17 and back require a small change for lack of task.c) -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "I apologize for the confusion in my previous responses. There appears to be an error." (ChatGPT) --ygvjcb67ii7yk42r Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-Fix-new-pg_upgrade-query-not-to-rely-on-regnamespace.patch" From 9da54743029ff9c3db0928acde3cd8c0f57c6d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Herrera?= Date: Fri, 4 Jul 2025 19:00:37 +0200 Subject: [PATCH] Fix new pg_upgrade query not to rely on regnamespace That was invented in 9.5, and pg_upgrade claims to support back to 9.0 I couldn't test 9.0 and 9.1 though, since they don't compile anymore. At least 9.2 is fine with this coding. --- src/bin/pg_upgrade/check.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c index a756ddbd254..30579ef2051 100644 --- a/src/bin/pg_upgrade/check.c +++ b/src/bin/pg_upgrade/check.c @@ -1689,12 +1689,13 @@ check_for_not_null_inheritance(ClusterInfo *cluster) log_opts.basedir, "not_null_inconsistent_columns.txt"); - query = "SELECT cc.relnamespace::pg_catalog.regnamespace AS nspname, " - " cc.relname, ac.attname " + query = "SELECT nspname, cc.relname, ac.attname " "FROM pg_catalog.pg_inherits i, pg_catalog.pg_attribute ac, " - " pg_catalog.pg_attribute ap, pg_catalog.pg_class cc " + " pg_catalog.pg_attribute ap, pg_catalog.pg_class cc, " + " pg_catalog.pg_namespace nc " "WHERE cc.oid = ac.attrelid AND i.inhrelid = ac.attrelid " " AND i.inhparent = ap.attrelid AND ac.attname = ap.attname " + " AND cc.relnamespace = nc.oid " " AND ap.attnum > 0 and ap.attnotnull AND NOT ac.attnotnull"; task = upgrade_task_create(); -- 2.39.5 --ygvjcb67ii7yk42r--