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 1wQjNp-001pSV-1m for pgsql-hackers@arkaria.postgresql.org; Sat, 23 May 2026 10:15:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wQjNm-00FXqp-0n for pgsql-hackers@arkaria.postgresql.org; Sat, 23 May 2026 10:15:03 +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 1wQjNl-00FXqc-34 for pgsql-hackers@lists.postgresql.org; Sat, 23 May 2026 10:15:02 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wQjNf-000000011gL-2VCo for pgsql-hackers@lists.postgresql.org; Sat, 23 May 2026 10:14:57 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-914bf787977so98108785a.2 for ; Sat, 23 May 2026 03:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1779531293; cv=none; d=google.com; s=arc-20240605; b=QVg/8FdMBlfzi5J8Bmj3ZTGaetBdWyue7/nnv3l/UlBUPk3jjfQZrllykbsSqcNeIq R66e9gcSo9L2ojZDcTGU4sq8G/pKTuaDqo6retKtyQiCJosL/j+o+MU+wvRPe2/zrcLS NH5Vu9EBfedyZs0xuqexi6F5VfSL/ttXSPhZTNgP611JuYBtM2HWnP3c/pukruUoGpHO IbCYvIfEjbByOggfnN7OLi2PUaUrBOTDjRLDhXJ3vnJ1SLTFAhTp6v/LgNZtOdvpHKXM MVgiZXqMS0LqcpF5GkZ6s3xiocYgYPus4dPm4LjSKD0RKuIeubHvUzwf0d3U+SDMH3n3 zCNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=oIRkjycw2nIKIrTcHAPtOcps+UiaVyaCAmT1hz+3g5k=; fh=tvS4T4+oR2J2hxK5aNJGfORVVBBvqUJPnvm76ijROZw=; b=G6QQN+dNp6JfpdwSPcwUREBW2N5v++buYQ0H27QPuNqlUZ51Fewjq7JU7WVQ9rZECG qOsw7VUPtolT3QQhXbmlVg6FpIu56sJuECzMIusPttSLXq0OFYacudu8vpMp8i69nlQN a1Ajwo+wvr7BDJNIsdx/DZP5BpUtzq0Jvl7akMj0aPgZMNK3Zk6exCdS3L2YJxWH4WKb JRIEIMvQEftGdIoXba9g7tDomMo8osy3oZyrqql1U7L3+td22io5AhB85w2xEw85heux SPblVdsl5jLhiNtD8N4ez73f5TDtL7a/SZY25IoHsI8OvT0eJ68td7yqK5yg+Ovq8KvO Wawg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779531293; x=1780136093; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oIRkjycw2nIKIrTcHAPtOcps+UiaVyaCAmT1hz+3g5k=; b=cIF/g64BQLbo+zgPWZy3BktTnVqGQLVjLUHd8wVZ7DjU/nJr9mJJy1isqW4DK22Mv1 Prtt0xm/0qo+UvyJr2XPU2aNx56QTOfuWla3hVOXGaWW0ldZsDd5JXUZf2r9t3N6KhLZ RgkW0eD/RBm0A408w/BzYHCmukJvIijypli4DHi7d8rg6hVkR/qUIVWX2fsIzyPDpm+w vI49EgTRW4VGg5KxT3dyhbElQqYrC2iJlHxi92b5+eLuQO8OiTCrY1vdDBFumcKR6V/2 LJU6ftZXuH4VTfv8pnLv/ouhfvXMzWecXA3amIM7m1ZheHkF3qD8qAsGaoUuBEm0CDhg V67w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779531293; x=1780136093; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=oIRkjycw2nIKIrTcHAPtOcps+UiaVyaCAmT1hz+3g5k=; b=CtYYFTIEUCTHhpRWU7pEkUJNEJ9yFyiK8D6EeYxmqoZ49lh1KCT1aBmqYwRfDS3kSY oIT0+iMW1Bk0hCrfPzjChSNhFTMbgr4O+7J1pOuLpfTO3S4L78+m/PGLqxdeexgZHoUf GQ17cbnHJzJ0/SubDU8gYvNqNGLF5+gdu7OAm6mBNwjGxIYBP5o+VFr9r2wuK5NlwXvI leY/N/b7qqM82FCgodsQFvN5bo8Oewe6MHjDa4FfPzfZ4+z9kPbF5WQbtV2wPw3oOLEA rkHGrYDf59Wr2HsX6KPb6eD6R2tYSHxf/W3SwyLL3s6rEhVaT++16KRlRM+NUDaAYe5P 4UIA== X-Gm-Message-State: AOJu0Yw1wPcSTtk8qFRSLTffeSz8MzA7AODx6iuS3Jil2YxK6dHZW7Ae GWcBGotJ2W+vs6DFGfsMExhoeeRFik8VwtP3zXFo8R0AhweV06/wJNm5oPCFAz+lkEoW/9nvx8q l6OzpK16kY306IGJUVa5dIaV4XL2wCXI= X-Gm-Gg: Acq92OEU1K2e2UjLh7E3X9cdsO9e6Li0K+JKrDOYYF/jW/1T/8/SezB3jnDgQa8/O8A 8esPqU/cgtil4sNS0riCqEISNTyOwiQDumCv4qNkeA9S8u17YSfAo5BtZ/izeNGwy6qnup+muOz GoHmtndUELAcr3cgYkISPpIQ/y4+0Ok7542in2a6oNWvuL8oR0I5gB8Ul6ElNHM0PALCEi9ccnO KbXCkGKNWlEuTxbeGpVrvurkqyPSgZxOMk94EzVmcaBGEUv1iB8irR3IY0CHOeSRdCMwqdn/2ht Ex6gs2jF51nmojMm19KHh1AQmaVI9N5bBxqq9jCvgzVfuatq07TwHRzg0L+w7zF6q2KcxnpCAdP 341AvXc7/44wpLdM= X-Received: by 2002:a05:620a:2794:b0:90f:fdb3:b752 with SMTP id af79cd13be357-914b4934c7cmr1058291785a.17.1779531293404; Sat, 23 May 2026 03:14:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kirill Reshke Date: Sat, 23 May 2026 15:14:42 +0500 X-Gm-Features: AVHnY4LowrEo7x6iXky7U9dxeHlYLgCoObv73cUSwx3w8SlU9UK8TDh951FiWxI Message-ID: Subject: Re: Pg upgrade bug with NOT NULL NOT VALID To: =?UTF-8?Q?=C3=81lvaro_Herrera?= Cc: PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 21 May 2026 at 22:18, =C3=81lvaro Herrera wr= ote: > > Hi, > Hi, thank you for looking into this. > 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. So, pg_dump will need to issue an SQL that says: please create this relation, but also never choose name1 to anything in the process. I guess this is not committable... Maybe you can clarify the design here? > 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. I also think we should make pg_upgrade just work in this case. --=20 Best regards, Kirill Reshke