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 1vtogJ-00Fblm-0i for pgsql-bugs@arkaria.postgresql.org; Sat, 21 Feb 2026 15:14:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vtogH-00ABfF-2S for pgsql-bugs@arkaria.postgresql.org; Sat, 21 Feb 2026 15:14:05 +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 1vtogH-00ABf7-1Y for pgsql-bugs@lists.postgresql.org; Sat, 21 Feb 2026 15:14:05 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vtogE-00000000Zvw-2a2U for pgsql-bugs@lists.postgresql.org; Sat, 21 Feb 2026 15:14:05 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-435f177a8f7so2947548f8f.1 for ; Sat, 21 Feb 2026 07:14:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1771686841; x=1772291641; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=5Bsz3VipzUf0XvOrwKjtsJfocK0UUYcFnaJi+mOH1Tw=; b=X9dQAg6Ob+OugM9lw/BPBVTpir7KnodFF/43qDzDXlXV5Ck2mEX/mPbpzAntJdzFAk lOTf2Pxo2s5aAqPz6LeUaykspPP/bHVxjrhfdVyB2RMTw0Zor9zpr8BJ1qBri22dpZ+Y XQvMwES0BUkPEk69/0b7JSe7WH5QsSsTD3kbsuMaX0UkcSpS5HkqOtduGjXtRRMK7M5e W9FCAmWCXro2AMm8MjEBjj9tzmqBOg9ApXoIWR9t47dAayubycvOLy1GIBFHbmy/FJqg z2nDrx9JMhEm+ie1gbNntm+n3sWcH/UNSLKkeTEUE/alhl7TO+XHnBsYHJ3l+JXNeMyW LBYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771686841; x=1772291641; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5Bsz3VipzUf0XvOrwKjtsJfocK0UUYcFnaJi+mOH1Tw=; b=nz5bh19N690+fZdF9Ws7vS9EpGBMu4AT5hsDp2Xe6DMJujc4L9pC0iSsPMQ+fQ4f+z //fA9uGsEQpGMuQO227pYbo1V0EhIobMWhLlwv106jktTTx2NxIEXlTCYhUs35X32j57 Z2R/PM5Al25NWEKg7ZYrOF3QY8+xMqHrWSTT75NOGFORYhHJiSF5ABqAAX+SESCXCI20 lIusd0Yvy3SxcWnhltfMr3iDaxxCuahkpxBQRBhz4PNwPiyO1mSXbOFrTvNOphmt3Rv8 wkW1jiB/lRDwu4kQAT6BbTutparLdBQSxK4uTCwrQxFlLOW65dPY0SGxGC4O9ZPuVYPP WUnQ== X-Forwarded-Encrypted: i=1; AJvYcCXy+JBtpwh+Btwxoh9zVkp0Uz1IUuAUJQTKtZxiFxj3K3JIlJZje45cFhSzI8+10tS5E+Z2vwnjKFQI@lists.postgresql.org X-Gm-Message-State: AOJu0YyXzHvei7vF4yOQA0LjDr0j9oIBq/k3xqYoVDjg8vM4KiEkQC0F 5XUvxESYk/6rfMWElpG+ixh7IMXya9XihLwtsSJ/JwTis21O0ZbOHPatwOd+nIiWX7Q= X-Gm-Gg: AZuq6aIfW83mx29ajLoHgbW4y9PZvAKgkcJH/HF5SBKYOpI+5jUL3FR82y/w85P/PZ5 z+nqJhFaLG8abdFMpXn9OSU1UsDa/n2RgoVupuKLxJxq9ib6CWCSZMovxvjehsoh5u3YcfXyzH/ +t44dxAKsO/tUKv/GKjbjIJPb7OzEWgwPo6Hjwzahh57zvmXbgne1nCbbsBeYlQ4Ridn1estlra nQqRfM15TCx1rfdmdN4DQAua5bGItVxq1Wv8fOuISMwCaoDL6NBnb/Gzs+7X5dSX8QyuEW0gDge p6OiTI6ZbAHXMbP817DPPl5gLo1OCYlXp4PFxtdyqBH2s50xNVtBDEnSHD4EXWYLniSYOfIIs+G R6U9OCRmd8cNpNHfPRz2A8JGHdptkZ255rWnJHiwR/YUT8k+8Or4/DyDwpzt93FzT1yPeNRp6yf Nvmt4S4WqIJ4P9yzUHz2NlgBVMdModMULNkUMWPh+jYph1ZXmkplyA5zqsHEmTb/vF X-Received: by 2002:a05:6000:4211:b0:435:a0ca:bdca with SMTP id ffacd0b85a97d-4396f185731mr5835517f8f.57.1771686840179; Sat, 21 Feb 2026 07:14:00 -0800 (PST) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:260:cdc9:baa5:8ffc:4801:4669]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d4cc81sm5361885f8f.26.2026.02.21.07.13.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Feb 2026 07:13:59 -0800 (PST) Message-ID: <55bdb57fe6d84b0acb56c369c699546086b983ca.camel@cybertec.at> Subject: Re: BUG #19393: pg_upgrade fails with duplicate key violation when CHECK constraint named *_not_null exists From: Laurenz Albe To: =?ISO-8859-1?Q?=C1lvaro?= Herrera Cc: huseyin.d3r@gmail.com, pgsql-bugs@lists.postgresql.org Date: Sat, 21 Feb 2026 16:13:59 +0100 In-Reply-To: <202602211127.yhfjy43if2kk@alvherre.pgsql> References: <202602211127.yhfjy43if2kk@alvherre.pgsql> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 2026-02-21 at 12:56 +0100, =C3=81lvaro Herrera wrote: > > On Thu, 2026-02-05 at 15:58 +0100, I wrote: > > > The bug is actually not in pg_upgrade, but in CREATE TABLE. The atta= ched patch > > > fixes the problem for me by avoiding given constraint names when gene= rating > > > the names for NOT NULL constraints. > >=20 > > ... and here is v2, including a regression test. >=20 > Thanks for this! I have pushed it now to 18 and master (right before > the embargo for next week's release -- not really apologizing about > that, since this is clearly something that's going to bite users as they > move up to 18). Thank you, and thanks for the code improvements. > 1. this will cause an ABI break report for AddRelationNotNullConstraints > in branch 18. I considered the idea of adding a shim function > preserving the original API, but I think this is not a function likely > to be used by third-party code. So I'll address this by adding an entry > to .abi-compliance-history instead. I decided not to worry about changing the signature of that global function= , because it is only used in a single place and - like you - I deem it unlike= ly to be useful elsewhere. Yours, Laurenz Albe