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 1uXj9c-00Degy-Vt for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Jul 2025 16:20:49 +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 1uXj9a-001vn9-Cz for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Jul 2025 16:20:47 +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 1uXj9Z-001vmv-IY for pgsql-hackers@lists.postgresql.org; Fri, 04 Jul 2025 16:20:46 +0000 Received: from fhigh-b1-smtp.messagingengine.com ([202.12.124.152]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uXj9X-005j7A-16 for pgsql-hackers@postgresql.org; Fri, 04 Jul 2025 16:20:45 +0000 Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id 028707A01A3; Fri, 4 Jul 2025 12:20:40 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Fri, 04 Jul 2025 12:20:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm3; t=1751646040; x= 1751732440; bh=15C0jwloVzhMbQqlXt87yy9BZvIXCjodQ+x6A7jAPus=; b=n NPEm7Asx8DwPyX65kPF4tp9IvcN+Hc5YB96OBEKAvQjhI3/rCI3884TzND4TG54s 93gEzH2r3cGtR6u5z415I1WJRbHxD93UEHs4Iqmu3f5AyXf+kwOqSqOKUJZjPQ+H b9bp3c169gj2gGqxWKPZNLAFhBTs+6YoTMxOflNFY68mGgU+DXG3iYcXSgj8VGRj yM5lxF+XOBqHmHcYhseyBBfVnIPe3+R1qOCHcK/3WwU+giwfEl/A/psQlnKpPQLf kGZdm3vEn4d3nUUrUu7DwkOZ6pL5SyRo+nZFC2EHWrfMQSW9oGT2NsgaBgkhe8Be lfVANjP/FrjcD9IXXlVaA== 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=1751646040; x=1751732440; bh=1 5C0jwloVzhMbQqlXt87yy9BZvIXCjodQ+x6A7jAPus=; b=BFakTHjTzbnUjnTS6 lA2e4pGBAkcnQDM5ltwZbz5VNhfKRjv71cAJ2kvr23DPBXivn3fUdGzGeUTaL4JR GK2ETc25FOiL2V+lwWqqHaQwpPDh1Y21hEski8e0GtOKriYuU5ihxaj1kwp5MCYK lPrp2kVENMxu02xg6/ZMmFAsE9Bcg7E767AO+xdCNpTKpAbfmie5vzw/VcrSztTc Cn2ZHc8zAbs/OCCdM/EY8nXlhowhgThr6EXvYlr4gHfdmJO/EtCVfczoZ8eFU7qA NxxkOeJTGrmEoziFKRzCSltuouE1RaLWNxyiXfzNmXKHcUHPTiXU9mq7Wb+5BZYy EkL1Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddvfeeivdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenogfuuh hsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpeffhffvvefukfggtggugfgjseht keertddttdejnecuhfhrohhmpemllhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrh hrvgeskhhurhhilhgvmhhurdguvgeqnecuggftrfgrthhtvghrnhepudehjefhuefgteeg udeljeeijeduvdffffeujeeuudetfeehieehteffieejtdfgnecuffhomhgrihhnpegvnh htvghrphhrihhsvggusgdrtghomhdpghhoohhglhgvrdgtohhmnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsehkuhhrih hlvghmuhdruggvpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgt phhtthhopehmihgthhgrvghlrdhprghquhhivghrsehgmhgrihhlrdgtohhmpdhrtghpth htohepthhhvgdrrghprggrnhesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhl qdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehtghhlse hsshhsrdhpghhhrdhprgdruhhspdhrtghpthhtohepphhrhiiisgihsehtvghlshgrshho fhhtrdgtohhm X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 4 Jul 2025 12:20:39 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1751646037; bh=QqZXOPkeRo1STApfnutO50tk8fjC9+wRw4iMCUi2bqU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=C1btyDgyFAdju+a30JjCFp2rV0Geb/3JyQ2+q+e0jtib4A/CTnB0wzmQ3q05j8QT5 mqXz/bSuKMmrSxj3zQD1dOVI1aT1MqZULPK8AfK3741DJ2Sqp42uSFAI0gZP+rUF0T xFdu27cK/MQy94R4qBXXMVWs+86hCS4idehBnf/QsRlLNKXWr9OzgehZaJ+j1SU/GU lNmNA56TXGyyRZJStx/jdmLf9hyR25Eb1zsGmm6vJzLkOQCtKyT0g+27/AcR9w8ZJb lngS0DxILqq8HUrWNDwXfwgqQ5YQlR2CaFxmAOvH8xSOCX5GG3vMoQN/7EZHYxh3zj en00nUFgGFUxA== Received: by schmee.kurilemu.local (Postfix, from userid 1000) id CCD1390; Fri, 4 Jul 2025 18:20:37 +0200 (CEST) Date: Fri, 4 Jul 2025 18:20:37 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Justin Pryzby Cc: Michael Paquier , Tom Lane , PostgreSQL-development , Ali Akbar Subject: Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL Message-ID: <202507041620.muotfjk37hqe@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171214054902.GC23527@telsasoft.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Two more minor things on this: I found it a bit silly to mention the ALTER command in the error message and then output only the three-part-qualified name in the output file (and no specific command to run) -- so for an instant I was tempted to write the full ALTER TABLE command in the output file instead. However I then noticed that check.c does not use fmtId() or fmtQualifiedId() anywhere, so that code would look out of place in check.c and perhaps even be a problem for backpatching. Do people thing it'd be an improvement to change it that way? On 2017-Dec-13, Justin Pryzby wrote: > Here are some spelling and grammar fixes to that patch: > > but nullabe in its children: nullable > child column is not market: marked > with adding: by adding > and restart: and restarting > the problem columns: the problematic columns > 9.5, 9.6, 10: 9.5, 9.6, and 10 > restore, that will cause error.: restore phase of pg_upgrade, that would cause an error. So the phrase "the problem columns" appears in multiple places in pg_upgrade/check.c. Should we fix them all? It turns out that I rewrote the message as submitted into completely different wording (without realizing that this had been reported), so these words don't appear anymore in the new commit. But we could fix these old ones while we're here -- yes? (See below) My rewrite is this: pg_fatal("Your installation contains inconsistent NOT NULL constraints.\n" "If the parent column(s) are NOT NULL, then the child column must\n" "also be marked NOT NULL, or the upgrade will fail.\n" "You can fix this by running\n" " ALTER TABLE tablename ALTER column SET NOT NULL;\n" "on each column listed in the file:\n" " %s", report.path); Here's what a patch looks like to change "problem columns" to "problematic columns". diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c index 2106869b999..ad80f00c055 100644 --- a/src/bin/pg_upgrade/check.c +++ b/src/bin/pg_upgrade/check.c @@ -119,7 +119,7 @@ static DataTypesUsageChecks data_types_usage_checks[] = gettext_noop("Your installation contains system-defined composite types in user tables.\n" "These type OIDs are not stable across PostgreSQL versions,\n" "so this cluster cannot currently be upgraded. You can drop the\n" - "problem columns and restart the upgrade.\n"), + "problematic columns and restart the upgrade.\n"), .threshold_version = ALL_VERSIONS }, @@ -139,7 +139,7 @@ static DataTypesUsageChecks data_types_usage_checks[] = "This data type changed its internal and input/output format\n" "between your old and new versions so this\n" "cluster cannot currently be upgraded. You can\n" - "drop the problem columns and restart the upgrade.\n"), + "drop the problematic columns and restart the upgrade.\n"), .threshold_version = 903 }, @@ -183,7 +183,7 @@ static DataTypesUsageChecks data_types_usage_checks[] = gettext_noop("Your installation contains one of the reg* data types in user tables.\n" "These data types reference system OIDs that are not preserved by\n" "pg_upgrade, so this cluster cannot currently be upgraded. You can\n" - "drop the problem columns and restart the upgrade.\n"), + "drop the problematic columns and restart the upgrade.\n"), .threshold_version = ALL_VERSIONS }, @@ -200,7 +200,7 @@ static DataTypesUsageChecks data_types_usage_checks[] = gettext_noop("Your installation contains the \"aclitem\" data type in user tables.\n" "The internal format of \"aclitem\" changed in PostgreSQL version 16\n" "so this cluster cannot currently be upgraded. You can drop the\n" - "problem columns and restart the upgrade.\n"), + "problematic columns and restart the upgrade.\n"), .threshold_version = 1500 }, @@ -223,7 +223,7 @@ static DataTypesUsageChecks data_types_usage_checks[] = .report_text = gettext_noop("Your installation contains the \"unknown\" data type in user tables.\n" "This data type is no longer allowed in tables, so this cluster\n" - "cannot currently be upgraded. You can drop the problem columns\n" + "cannot currently be upgraded. You can drop the problematic columns\n" "and restart the upgrade.\n"), .threshold_version = 906 }, @@ -279,7 +279,7 @@ static DataTypesUsageChecks data_types_usage_checks[] = gettext_noop("Your installation contains the \"abstime\" data type in user tables.\n" "The \"abstime\" type has been removed in PostgreSQL version 12,\n" "so this cluster cannot currently be upgraded. You can drop the\n" - "problem columns, or change them to another data type, and restart\n" + "problematic columns, or change them to another data type, and restart\n" "the upgrade.\n"), .threshold_version = 1100 }, @@ -292,7 +292,7 @@ static DataTypesUsageChecks data_types_usage_checks[] = gettext_noop("Your installation contains the \"reltime\" data type in user tables.\n" "The \"reltime\" type has been removed in PostgreSQL version 12,\n" "so this cluster cannot currently be upgraded. You can drop the\n" - "problem columns, or change them to another data type, and restart\n" + "problematic columns, or change them to another data type, and restart\n" "the upgrade.\n"), .threshold_version = 1100 }, @@ -305,7 +305,7 @@ static DataTypesUsageChecks data_types_usage_checks[] = gettext_noop("Your installation contains the \"tinterval\" data type in user tables.\n" "The \"tinterval\" type has been removed in PostgreSQL version 12,\n" "so this cluster cannot currently be upgraded. You can drop the\n" - "problem columns, or change them to another data type, and restart\n" + "problematic columns, or change them to another data type, and restart\n" "the upgrade.\n"), .threshold_version = 1100 }, @@ -423,7 +423,7 @@ process_data_type_check(DbInfo *dbinfo, PGresult *res, void *arg) pg_log(PG_REPORT, "failed check: %s", _(state->check->status)); appendPQExpBuffer(*state->report, "\n%s\n%s %s\n", _(state->check->report_text), - _("A list of the problem columns is in the file:"), + _("A list of the problematic columns is in the file:"), output_path); } state->result = true; -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Ed is the standard text editor." http://groups.google.com/group/alt.religion.emacs/msg/8d94ddab6a9b0ad3