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.96) (envelope-from ) id 1wQlIz-001r45-1U for pgsql-hackers@arkaria.postgresql.org; Sat, 23 May 2026 12:18:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wQlIx-00FfWx-17 for pgsql-hackers@arkaria.postgresql.org; Sat, 23 May 2026 12:18:12 +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.96) (envelope-from ) id 1wQlIw-00FfWo-1M for pgsql-hackers@lists.postgresql.org; Sat, 23 May 2026 12:18:12 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wQlIu-000000012O2-0QcX for pgsql-hackers@lists.postgresql.org; Sat, 23 May 2026 12:18:11 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 291BB1D000A1; Sat, 23 May 2026 08:18:05 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Sat, 23 May 2026 08:18:05 -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=fm2; t=1779538684; x= 1779625084; bh=jaqZyW5eKBRI3rj/NyOYqwsxaQnuXo7MRZMv6zIFRQw=; b=e OftTu71JCh3i+OW4PjAv+Q6sWwDDCod4lBK2tNzYn3cS043DfV4Mg5UrxMN021zI Te+M2y2reDppDsWVV0n8xf2JG8/NzXGhYN1hW28mQF7Sk+6VyCumhUi3crdK0vxh skpEha+N7ZODhHJvLIoXXc41b8lSfWdqidJeZ7Y4v26bXEropqjyhAzCIaPVJmhr CjddyqQCcgm6gvzR1UCMqZzNRuLHyhnurK6otFSa0G7ZuSNS1pnuwJ6DAHFvjRov /417Xf3EvFcGMGVj3/jaElH+zX0xnFokD6B1tV7ieYq/qDzagvvFNYNpNXa9fJDl wxFWXJZO8b/E/yoR67DMw== 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=fm3; t=1779538684; x=1779625084; bh=j aqZyW5eKBRI3rj/NyOYqwsxaQnuXo7MRZMv6zIFRQw=; b=vNj0Il8U7676TeUl6 p7v867DlFlwH1tFrZyhPbRYx/dPKk36+oVFpcuOrQl6gAi/CRDA0oRW64MtvryL6 kpcoGgNXpJind9IW2muJWo/sb0awiwjvPocRt2D4uPFlybEKrIgA98hFdBBjTHNs At+fBp5RjmnXsiaFPpVAm7ildf08h8Wt1WwbVwdHpph4luiTGNE9bX4H9a2vDDTg b8Z/bUeKAJdSvmbYXr2z6yKVs7T4upa4lrQUy169Mu58Th7Jxh/d/jBVcFNMvtPU fms0VRWmUMLI8G6RemX5lsDeP3aRPhIw5wV9aQHz0ku5Y5wYCsMCz4SX9r15T3FZ QCFMw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduheeftdefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeetuedvheffkeevgfeuheevteevkefggedttdeufeeuheduuddthfef fffhjeefffenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehrvghshhhkvghkihhrihhllhesghhmrghilhdrtghomhdprhgt phhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlh drohhrgh X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 23 May 2026 08:18:04 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1779538683; bh=fOvt6whOQcDMbb2Jj5AJtlJNaE6vOkK5SzQUT+QhMno=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=LPKwlz0WgZDILq1/Z6p8aHAMItV8UFIpiBpzYtCJVCzbONuvgwtr17O1BZgpl5vDk GjUez1EJoYcuv1p5lKUOzWrbALJKiej+DFumDD/D4PSfzYbwZpPYmNhfNZx7k8+1Z/ SPnLwpM04mVlbRIWIT8WXixOKYUaegbuRGbbalk8vXiD1a2SM97ZgAwMMnjJAfqQZr MVWTcCyn5XdaDxQAyJ5xpq0kCrTx+bYAJ20gUzrUmyoxNjhYMcNW3XW3kq7Hf5Uw8C /5Y2SEzuv41avqxuelRk6ANDxBOJwNsyYW+KRP5aXKmweeKo2GVwkPpnN69mzuEqSP XRqJESt4DQfcg== Received: by ida.kurilemu.internal (Postfix, from userid 1000) id 792B7B042D6; Sat, 23 May 2026 05:18:03 -0700 (PDT) Date: Sat, 23 May 2026 05:18:03 -0700 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Kirill Reshke Cc: PostgreSQL Hackers Subject: Re: Pg upgrade bug with NOT NULL NOT VALID Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-May-23, Kirill Reshke wrote: > On Thu, 21 May 2026 at 22:18, Álvaro Herrera wrote: > > I see two alternatives. One is to have pg_dump --binary-upgrade choose > > a constraint name for the not-null with full knowledge of all other > > constraint names, so that we know to generate a non conflicting one. > > I suspect this is not easy to code. > > Well, for this option, we need to be told about what other constraint > names that are about to be created. Sure. Of course, pg_dump can run all the queries it needs to obtain constraint names, so it's certainly doable. > > The other is much simpler: make pg_upgrade -c warn you about the check > > constraint name so that you know to rename it before the upgrade. > > I don't think this is good when the database asks you to change your > DDL because of its internal troubles with something. OK. I disagree but I'm not opposed if you want to do it the other way. If you prefer that I write the patch, that's fine too. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "La espina, desde que nace, ya pincha" (Proverbio africano)