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 1tlNJZ-00BT7i-Ev for pgsql-bugs@arkaria.postgresql.org; Fri, 21 Feb 2025 07:19:13 +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 1tlNJX-003ySR-BK for pgsql-bugs@arkaria.postgresql.org; Fri, 21 Feb 2025 07:19:11 +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 1tlNJX-003ySJ-1Y for pgsql-bugs@lists.postgresql.org; Fri, 21 Feb 2025 07:19:11 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tlNJV-0026nD-00 for pgsql-bugs@lists.postgresql.org; Fri, 21 Feb 2025 07:19:10 +0000 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5dec996069aso2835927a12.2 for ; Thu, 20 Feb 2025 23:19:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1740122348; x=1740727148; darn=lists.postgresql.org; h=mime-version:user-agent:references:in-reply-to:date:cc:to:from :subject:message-id:from:to:cc:subject:date:message-id:reply-to; bh=tVX048zKRkc8wbjpeeU5Age5M3kE9JIwO1VUB1sPdHA=; b=sXfar/xwlUSJBkUxukAABwZqSZRmVGSDv6rOvuhOVcFwgHTzjXE6DuyR9UsGcBL6Mb 7LKDLgmdRtV1E33b3LQj2LFO8E1d1ItlXczzqKkDUx9TSTYLPaUsmD7HFezGhPbruA9V w0zmbVrVzZXm+D8JNfpqXmxzSGPcTP0tfDVzupttanMeovufk74LnWsiaMlEhWPhb8fw i8fY8wHpt9au4RyRkyNUZT+rAH4NGDuaSpWA4BRRObOIudVIwxMa9V0XhoZhtRhdG7oE H55kiqsUQhCc10JpssDde5JF3p5aILDjjKGMwwpNJ0AsFGPtKVG/bzo3vGDXS3jF6okd r4CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740122348; x=1740727148; h=mime-version:user-agent:references:in-reply-to:date:cc:to:from :subject:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tVX048zKRkc8wbjpeeU5Age5M3kE9JIwO1VUB1sPdHA=; b=HJ1dVkrekT3HzWPvjQNahaiBT/eFKIEXZi5fllkmnJikwj3dJvTsbmOGsrZ3TnbgaK ikGJDAcDsS6yt+U8fIyp+VSzvWYCJL/+fuast8bEYg9gUwTrkF6vRVa3Bgfz807GHSJq va5H88uykEzV1yJn9mDNjZYT4hiCn1EZ9Q96L0ZKFXacaGvY1wxOj/4srYwITRUMNkSv DMrBMFqIpRCB8UzBR2cz4r8Sd33ScZQCCcfqCK1ggc1FEweUDoSaABhOQAV//E/3cLlr eC6qEUuRq2pzzqwx7kS20jug1YDz73mhZn981WK4+UNC7EJdabZdoyD4hiVYp50VXIkX nqFg== X-Forwarded-Encrypted: i=1; AJvYcCUvG578g4fbMhpMdMRd/S53UiU/lPUl5Acnjf/dBvT74AbECqUgxg8wzXl/W+Gcn1XSx56AoN8P8s27@lists.postgresql.org X-Gm-Message-State: AOJu0Yw5DaZlG4SHqzslKihydmfEcxSco7q784JxwCl9kVSv7JaeGfzC V2ENAfl+EIa6sjLS9KnQgY2an9wwFPF2IxsQQKneR60tDgW7lRbUpQSQwFqiT/qUFTF1vgmZ+wT t69Ob87oy6IYlKl7YYDbtTy2tHWai2Day4sny0Nkd7cXejzWRDY0yKPYee8YH X-Gm-Gg: ASbGncuFWWU5GzhnudasOLUXNbjBgSdxhrKApVgRDzmvedhYyZ5YI8hVGGDsEyNe5L5 shrN2J+XFoSBVGX0TjH87R238or00kwqF+fQwtLCNZGIAdt3pbgtU8LlcDD1vGdpMErEcSavXne TLM/e7V54PZ+nt6NfGG61E1JChH9HZVKmsOZpwAKkWmAYzftAhGCi5GkCLrKqqhQYgZXYGHu0cj mNC9toXJOobEilIuRo+Vl813baLl9FbruD3eKXFLHxZutHAJcP+VW5SjQzW5VYD35ieU6d10xcM BLbSrY4yp8RWe87ddxkkFtJ1v5TyOtqizyPZMtcYYw== X-Google-Smtp-Source: AGHT+IFqmCrhp+7wexbnRzBC1Vl7LqFYewxdUhgmtS2RV9y0wsNk63bFfWdYczYnD1hv6RqgFDT/bw== X-Received: by 2002:a05:6402:3508:b0:5e0:43bd:60d6 with SMTP id 4fb4d7f45d1cf-5e0b722e1a2mr1663557a12.32.1740122347733; Thu, 20 Feb 2025 23:19:07 -0800 (PST) Received: from localhost.localdomain ([41.66.98.54]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dece2881b3sm13413422a12.77.2025.02.20.23.19.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2025 23:19:07 -0800 (PST) Message-ID: Subject: Re: Major Version Upgrade failure due to orphan roles entries in catalog From: Laurenz Albe To: Tom Lane , =?ISO-8859-1?Q?=C1lvaro?= Herrera Cc: Virender Singla , pgsql-bugs@lists.postgresql.org, Aniket Jha Date: Fri, 21 Feb 2025 08:18:12 +0100 In-Reply-To: <2939991.1740089974@sss.pgh.pa.us> References: <202502131716.7mgkcnrem2hn@alvherre.pgsql> <2939991.1740089974@sss.pgh.pa.us> User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2025-02-20 at 17:19 -0500, Tom Lane wrote: > After looking at this I thought it was worth a little more code to warn > about the dangling role OID, instead of just silently ignoring it. > Here's a couple of more-polished patches. > > I'm unsure whether to back-patch the 0001 patch, as it does imply > more pg_shdepend entries than we have today, so it's sort of a > backdoor catalog change. But we're mostly interested in the > transient behavior of having a lock+recheck during entry insertion, > so maybe it's fine. 0002 should be back-patched in any case. I'd say that adding new catalog entries in a way that is compatible shouldn't be a problem, but I still wouldn't backpatch the 0001 patch, because it is not necessary. The orphaned pg_auth_members entry didn't cause any harm, and a few warnings more during an upgrade shouldn't be a big problem. I have one question about the first patch: > diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c > index 0db174e6f1..0c84886e82 100644 > --- a/src/backend/commands/user.c > +++ b/src/backend/commands/user.c > @@ -489,7 +490,7 @@ CreateRole(ParseState *pstate, CreateRoleStmt *stmt) > * Advance command counter so we can see new record; else tests in > * AddRoleMems may fail. > */ > - if (addroleto || adminmembers || rolemembers) > + if (addroleto || adminmembers || rolemembers || !superuser()) > CommandCounterIncrement(); > > /* Default grant. */ That change seems unrelated to the problem at hand, and I don't see it mentioned in the commit message. Is that an oversight you fixed on the fly? Apart from that, the patches look fine. Yours, Laurenz Albe -- *E-Mail Disclaimer* Der Inhalt dieser E-Mail ist ausschliesslich fuer den bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein sollten, so beachten Sie bitte, dass jede Form der Kenntnisnahme, Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhalts dieser E-Mail unzulaessig ist. Wir bitten Sie, sich in diesem Fall mit dem Absender der E-Mail in Verbindung zu setzen. *CONFIDENTIALITY NOTICE & DISCLAIMER *This message and any attachment are confidential and may be privileged or otherwise protected from disclosure and solely for the use of the person(s) or entity to whom it is intended. If you have received this message in error and are not the intended recipient, please notify the sender immediately and delete this message and any attachment from your system. If you are not the intended recipient, be advised that any use of this message is prohibited and may be unlawful, and you must not copy this message or attachment or disclose the contents to any other person.