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 1wWFnD-002UG0-2x for pgsql-bugs@arkaria.postgresql.org; Sun, 07 Jun 2026 15:52: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 1wWFnC-00HOLI-1v for pgsql-bugs@arkaria.postgresql.org; Sun, 07 Jun 2026 15:52:06 +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.96) (envelope-from ) id 1wWFnC-00HOLA-15 for pgsql-bugs@lists.postgresql.org; Sun, 07 Jun 2026 15:52:06 +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.98.2) (envelope-from ) id 1wWFnA-00000001YVQ-2Dv5 for pgsql-bugs@lists.postgresql.org; Sun, 07 Jun 2026 15:52:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 657FpxJe104813; Sun, 7 Jun 2026 11:51:59 -0400 From: Tom Lane To: Greg Sabino Mullane cc: huseyin.d3r@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19483: pg_upgrade fails with orphan records in pg_init_priv catalog table In-reply-to: References: <19483-80de42dc4e62cfd6@postgresql.org> Comments: In-reply-to Greg Sabino Mullane message dated "Wed, 20 May 2026 09:06:58 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <104811.1780847519.1@sss.pgh.pa.us> Date: Sun, 07 Jun 2026 11:51:59 -0400 Message-ID: <104812.1780847519@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Greg Sabino Mullane writes: >> 5. Verify orphan records remain in pg_init_privs: > Thanks for providing a failing use case. I ran this on a 18.3 server and > found no orphaned rows - but I used the pg_stat_statements extension > instead of pg_wait_sampling. Could you try your experiment using > pg_stat_statements? And could you also show us the contents of the errant > rows in pg_init_privs for the failing case? The orphaned-rows problem shouldn't exist in v17 and later (see 534287403, 35dd40d34, and related commits). The OP is apparently complaining about an upgrade from v14, where such rows could exist. I don't especially care for the proposed fix of making pg_upgrade refuse to run. Manually correcting such situations would be tedious and error-prone. Plus, it's inconsistent with what we did about related issues with role GRANTs (see 29d75b25b and 74b4438a7). I wonder if it'd be sane for pg_dump to just skip dangling role references in pg_init_privs. regards, tom lane