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 1ticou-000VXM-7T for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Feb 2025 17:16:12 +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 1ticos-00BDfB-6M for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Feb 2025 17:16:10 +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 1ticor-00BDf3-TM for pgsql-bugs@lists.postgresql.org; Thu, 13 Feb 2025 17:16:10 +0000 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ticoo-000eGF-23 for pgsql-bugs@lists.postgresql.org; Thu, 13 Feb 2025 17:16:10 +0000 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 3A594114024B; Thu, 13 Feb 2025 12:16:05 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Thu, 13 Feb 2025 12:16:05 -0500 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=1739466965; x=1739553365; bh=9 6tR2bXO62NV2R4dqJ38uP47jmfdxExp1wgM+5XuAG8=; b=W2vSCRRbQtdLuTHEg DWi1scQ5ni/AwKxJkTwp0NC6FijECzezKoRxplFqI1wCVgHC83jIoiL2RoMAo+Pw mowG8tloeacKb2vmNJJdppOQLr7hMvZf9JzkYHvxTq/L1SLBmASvkj1+t8Bt/0Cf gc1yWpYn3KdK6ALN5NYbL8XKcaIZ/AO132KyEt8bi77rQNSH9DbC3avgTQ1c90QO GBzXtNEre0NnAJa/2PvNt91RZZLVIe5SgDUcJ3T/zXSf5ayv0vkyAZ49I8O6THY6 GHy9qNeAZVsKbjQ0NcodsTyFUe+q/D1uWpI6yBLFnJwInuwLNrJTRI650VfkK+Xu JK1BA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdegjeefhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvf evuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhhoucfjvghrrhgv rhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrth htvghrnhepheejteegjefgfeelfeekjedvtdfhieeuieffjedvjeekteefledtueffjedt ieeinecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhdpphhoshhtghhrrd gvshenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegr lhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprhgtphhtthhopeefpd hmohguvgepshhmthhpohhuthdprhgtphhtthhopegrnhhikhgvthhkuhhmrghrjhesghhm rghilhdrtghomhdprhgtphhtthhopehvihhrvghnuggvrhdrtghsvgesghhmrghilhdrtg homhdprhgtphhtthhopehpghhsqhhlqdgsuhhgsheslhhishhtshdrphhoshhtghhrvghs qhhlrdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 13 Feb 2025 12:16:04 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1739466962; bh=8KkvM/BzF/Wx5d571ewT98NSJuEgs4InA5VcJBrj9no=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=JRXOqjFGubEeyI4wuVw7F94sOlt4HIlP+P78knxNIrKi7XSj1T2udQcEaFpGoeloW ntexPvY/0gxvplpElTLI6QQWhYnMq3qL2/rVp+0pLliNjcG1DklOKTqAxLxrRP8tC1 tREIquMQyRu5dMJJ+u71da7dGJx+AN7P5Tp2qQgJuzc8mJJt5+kmpVW2FH0oY8ZXsn +lYGbwznbiiJIkkra8eDv+Oa3YdytlaXMXbugp3OfCxYGsUkL6o8x8Cu/3r2pgRSw5 cmvcNyQP+ia8tKPnultlCKYytf8dSgIJTQQLICYsOlvfIyvzRqL/krAQuNw1urogyZ 8nKtQt4T1Wh5A== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id F2AC46D; Thu, 13 Feb 2025 18:16:02 +0100 (CET) Date: Thu, 13 Feb 2025 18:16:02 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Virender Singla Cc: pgsql-bugs@lists.postgresql.org, Aniket Jha Subject: Re: Major Version Upgrade failure due to orphan roles entries in catalog Message-ID: <202502131716.7mgkcnrem2hn@alvherre.pgsql> 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 2025-Feb-11, Virender Singla wrote: > And the upgrade fails with an error : > > > *GRANT "my_group" TO "" WITH INHERIT TRUE GRANTED BY "postgres";ERROR: > zero-length delimited identifier at or near """"* > > The issue seems to be coming from pg_dumpall for building grants during > pg_upgrade. Hmm, I think fixing the bug as Tom suggests downthread is probably a good idea, but I think we should in addition change pg_dumpall to avoid printing a GRANT line if there's no grantee. Maybe turning one of these LEFT JOINs into a regular inner join is a sufficient fix for that: /* Generate and execute query. */ printfPQExpBuffer(buf, "SELECT ur.rolname AS role, " "um.rolname AS member, " "ug.oid AS grantorid, " "ug.rolname AS grantor, " "a.admin_option"); if (dump_grant_options) appendPQExpBufferStr(buf, ", a.inherit_option, a.set_option"); appendPQExpBuffer(buf, " FROM pg_auth_members a " "LEFT JOIN %s ur on ur.oid = a.roleid " "LEFT JOIN %s um on um.oid = a.member " "LEFT JOIN %s ug on ug.oid = a.grantor " "WHERE NOT (ur.rolname ~ '^pg_' AND um.rolname ~ '^pg_')" "ORDER BY 1,2,4", role_catalog, role_catalog, role_catalog); -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "I am amazed at [the pgsql-sql] mailing list for the wonderful support, and lack of hesitasion in answering a lost soul's question, I just wished the rest of the mailing list could be like this." (Fotis) https://postgr.es/m/200606261359.k5QDxE2p004593@auth-smtp.hol.gr