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 1tlUE0-00COJp-56 for pgsql-bugs@arkaria.postgresql.org; Fri, 21 Feb 2025 14:41:56 +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 1tlUDy-00AjsK-8J for pgsql-bugs@arkaria.postgresql.org; Fri, 21 Feb 2025 14:41:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tlUDx-00AjsB-WC for pgsql-bugs@lists.postgresql.org; Fri, 21 Feb 2025 14:41:54 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tlUDr-0026eD-34 for pgsql-bugs@lists.postgresql.org; Fri, 21 Feb 2025 14:41:53 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 51LEfhC03073714; Fri, 21 Feb 2025 09:41:43 -0500 From: Tom Lane To: Laurenz Albe cc: =?ISO-8859-1?Q?=C1lvaro?= Herrera , Virender Singla , pgsql-bugs@lists.postgresql.org, Aniket Jha Subject: Re: Major Version Upgrade failure due to orphan roles entries in catalog In-reply-to: References: <202502131716.7mgkcnrem2hn@alvherre.pgsql> <2939991.1740089974@sss.pgh.pa.us> Comments: In-reply-to Laurenz Albe message dated "Fri, 21 Feb 2025 08:18:12 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3073712.1740148903.1@sss.pgh.pa.us> Date: Fri, 21 Feb 2025 09:41:43 -0500 Message-ID: <3073713.1740148903@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Laurenz Albe writes: > I have one question about the first patch: >> - if (addroleto || adminmembers || rolemembers) >> + if (addroleto || adminmembers || rolemembers || !superuser()) >> CommandCounterIncrement(); > 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? Well, kinda, because the patch doesn't work without it. The problematic case is where none of those 3 flags are set and also !superuser, so that we decide we need the default grant implemented a few lines further down. That grant now has an explicit reference to the new roleid, and if we haven't CommandCounterIncrement'ed, the pg_shdepend code will error out because it doesn't see the catalog entry for roleid. regards, tom lane