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 1wXYI4-003KM8-12 for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Jun 2026 05:49:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wXYI3-00ETbo-0I for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Jun 2026 05:49:19 +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 1wXYI2-00ETbe-2f for pgsql-bugs@lists.postgresql.org; Thu, 11 Jun 2026 05:49:18 +0000 Received: from mail-oo1-xc36.google.com ([2607:f8b0:4864:20::c36]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wXYI0-000000028ER-3E0a for pgsql-bugs@lists.postgresql.org; Thu, 11 Jun 2026 05:49:17 +0000 Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-69e4d51b15dso5057581eaf.2 for ; Wed, 10 Jun 2026 22:49:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781156956; cv=none; d=google.com; s=arc-20240605; b=TMXs2ajyYepld5DFXmkGO8hSrZsoeq42YMQXT6C+KEeOXvcu8CnYUWWuf4Q0ZriD/l uS6JpItUXfR7xWCbzRhGWSb5rZT0Bw9vpkZWYi94PG63BvigCCXUEe0qjumrzDS9n2ka IxuD9+yiQXwB02XPD7ztvyB5SbOPe0syNTdwX2KFGtH7I/wQEtzy3khHpuOjcrRqo9ww NVffhdcMXgnmGM7AF0XTt8dRiiqp46XPemeUeomKL8qHS3N32kgoI9c1MwrC375i37ln 5g5Fuz9sN6P2Fm6Va+a8egMREfkrl5b1JudUZ4zcKGwdO1Xoen5YaE81AFRTM1fsXkyp eiKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zsKZWeDlAYY77kVu1un0YLcklp7BU1OaNgUBB6T7Nls=; fh=lH6aZjy/BRlmqmC11v1geYBmzG6uZGy2oJdpXt8H8mI=; b=GZ5QOXAihqSbngDIwpIZXOt1vgojZieg8a3B93xBstVJF+OyF3qcit5FmxLSKablhf N/QTHlNXblb7TqiIseA7E+YaBH9c8qCOPyTQA+DrHy7jsa1YzJxt3MQ+wEEz7RCYAENa /H7b7SstT0KyLEzGd9llUT9Ja3xemBcDgEui1UHZnWogMQ9h37HnvOH1deMNiml8tfq8 qxUNUbycC72Mt7FplPPep8hV5+wIyOXyaSjIxXKrtZFPSXxoX+K01CZHcCst563wlige yWnrTO++8iaHekrvC3DG0ohnKh1QNrUDVpYv6BOxTwBZqcckNs3bdu6r/eT2CrKe8d8o 6rvg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781156956; x=1781761756; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zsKZWeDlAYY77kVu1un0YLcklp7BU1OaNgUBB6T7Nls=; b=VKOBRhLWL7qz5XwXW/guW63vjlE+u9zjyH+pz74hfVxCcKnzD8dADNS6hXpd0PfTAj YSEt4YrBzjhPFxHfGWIwlGaIJhqC7uZ7NzKSGyfWybknyB2WMA8ucYRC4xXcq6qh6gj8 MmcTzRiqTSLrR1cEfwsusQHm8Q+RFyEOVbaZsNalcxrXzWxkVdI4xBekhLhhz3K95cJ6 xMo8c+RgfOmgq+F5SI2z75FqVcgUeyZa+Hu8OeTe6jM7B0WBjO/axMMgS+K12K2SA5vB ufVuiG1B6STErgoYkz5QvA6xFUDhWBaywYtI3WSFWncabaBmZHjypVn8qOmSW77XgRtp ka6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781156956; x=1781761756; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zsKZWeDlAYY77kVu1un0YLcklp7BU1OaNgUBB6T7Nls=; b=PgwA408UmRRoLbsXxPvCskcja7SO5ITBjOOUSUTmuAo9XvHv3WyyKruG4ZEi1irm0e 6mTs6ks2iTaGkA+WjwHSD6aGKv5IvzfERESKFVpaifhTrIXJrJeBdHtXkG2NFp8JltBP 4WVU+0v+URx7JwZTCTd47OwIHiJsYM93eaPwj+QcPlW5T5ZWh7KolXy1FwDZBDAqi0N9 pBdtQJ3DqpjwpK+7Z9dJI+QG4sdHo5FRnDtfv7iOp+otyEWbf0K/XUK6xQJdlu+tLPIP WGI7LKWZesfNK7EqIVzBgElQuseT5i/9bQkAOyko15XTUnvB+GdEfF5WzqytRRDbIy4A AJCw== X-Forwarded-Encrypted: i=1; AFNElJ/+XIZmdR40ZhEGYKKuNaq396pr3qwsek4b3WnC34GTuOIiRmIZSYCtUZ5kx6JAAcLvjUR3sMDpseBc@lists.postgresql.org X-Gm-Message-State: AOJu0YzMV0HcJg3sIPfuYlm48U4qraYXMGY1SfABq1suVJDhOxoX6jTv nVSpCm+QJUArL2WVf8WzZ4FyfUqEqjDgLwsutPdUfY7GKNmQ+uKSsUvenyMOjC41NjQMJNwohXk bz4/Q4U781kcJYba6joihQxeq4f9Rk5I= X-Gm-Gg: Acq92OH8B29PvzZ74QzfMJPebga/pWqXwfn+JlCq2vDI8GoSxQJbr9/eyJDBt2duE/I au1gMAtxpPOPAIJ1vwZ1cOkNra54G9q9WZURv+0jqtOmcqyh2KC7rTscGCTbzaX4FbNoMRamdnc bkQDwRtATaOetRKzs3NxnSpkyZdJnuFXuV3fRE/sI2lCOqkY790WiNMGI2MXIDQgs+qAaw3jKfX O71PPLLcOnoGZ+Oq+PJoBVLs2cdMrx2x33ILHTwGDjkoqg5JzhIx6erCQPfeMoas9ML4UnzJg5L NRH9HJokYn4wuQCcOpMuaWuEQuCI/zuF1WMiZJq8IB5H5gWpG+PuGLobEmknZUujyQEQCIPztjC 5f/hpBa0iBCR03OyxKG/AN4U5gKNyg4TssCJpdalV5JIimBc= X-Received: by 2002:a05:6820:4c13:b0:69e:4008:13e4 with SMTP id 006d021491bc7-69ecae4bec3mr926451eaf.17.1781156956127; Wed, 10 Jun 2026 22:49:16 -0700 (PDT) MIME-Version: 1.0 References: <19483-80de42dc4e62cfd6@postgresql.org> <104812.1780847519@sss.pgh.pa.us> In-Reply-To: <104812.1780847519@sss.pgh.pa.us> From: =?UTF-8?Q?H=C3=BCseyin_Demir?= Date: Thu, 11 Jun 2026 07:49:05 +0200 X-Gm-Features: AVVi8Cd2J2pnBVlfG4WhvXCZtWvdpu5LrGzQRqR46nNi1ZT7c7_ZAp8GyaA3Ztk Message-ID: Subject: Re: BUG #19483: pg_upgrade fails with orphan records in pg_init_priv catalog table To: Tom Lane Cc: Greg Sabino Mullane , pgsql-bugs@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > 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. Yes I was working on upgrading the PostgreSQL version from v14 to v18 and was able to solve the problem by removing the danling records from pg_init_privs. > I wonder if it'd be sane for pg_dump to just skip dangling role > references in pg_init_privs. It will change the behavior of pg_dump and it's a general purpose tool because when we instruct pg_dump to filter orphan records it will change the content in the system catalogs. For now I suppose we have two options: either pg_upgrade or pg_dump. Regards. Tom Lane , 7 Haz 2026 Paz, 17:52 tarihinde =C5=9Funu yaz= d=C4=B1: > > 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 an= d > > 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 erra= nt > > 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