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 1vvFQ9-00AKcC-2z for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Feb 2026 13:59:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvFQ8-006X46-2N for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Feb 2026 13:59:20 +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 1vvFQ8-006X3y-1b for pgsql-bugs@lists.postgresql.org; Wed, 25 Feb 2026 13:59:20 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vvFQ5-000000017xh-0LU9 for pgsql-bugs@lists.postgresql.org; Wed, 25 Feb 2026 13:59:19 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-65f771c6b89so1804204a12.3 for ; Wed, 25 Feb 2026 05:59:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772027957; cv=none; d=google.com; s=arc-20240605; b=BsXjJUc+xzu6Sm10QXjkwQ4Rpkw41ECCs5+9ZO1/job9EjHfh/z1OPoRFnOzpx/f6y wnTwuGFSlFwSIHrcl4MHYc5WrC+aZsMJoCDhWwTYA9jT2UNDHVoO4xlO6EEyWpCamGyI L0/fTqlPlKICmE2Fznt6xBeojR7w0VwQpyGb4UEYQT0x8yJM+Z14X5sbMiTb7QzovoPv w6AoOQngxLpeYMyHWzgcCJ3qH7JPnKcVW5KaRs89y6E99Pdh1FBt2LpPB6P96860Anxx tAkEEZ9hK3wXQrhZzQmStOebL682JrZHAo+vAjkaeZFDnsdf2Tz+d2CmwP7EbiTmhdad T03Q== 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=Zr1IMpBxPi2QmGUGN0kY17ZGeUT+drEE+wl3E5t2Ckw=; fh=Rj1mn5vCdSMYLj0J9bR6N8sWjJOCg/G8q7u+ylBhkys=; b=cc8JLKnhSCkbRbBZJOME27BUfEyHaeyUhpbhK3T8mKL6IuWCmd2Q3iiO+XGQz37w4d QQPAamNuoGUKd49feLjm99lPc0uMwivBf3nzQh6QY42gytP/pHXXDNg7GUkr/QhEuVqG QMcALJPU/JHYaBtqymlaU1AXTlfohcqqGm3eHhZgd+GkYLy/QSVJjQidNAQ9AMtfuMVy GzlsDqzZm3l7fvXWroLhadDkb/Ly5WCAT/tA4xTuIf202M254jUt/EK0ms58pnVeTkXL WFRTNAgaoAmkpRNwIvzdbHf8YxPc0TllRb3MQG4ruZRqDtEexyhhWjWhDrW+ZIJD+P9e Axsg==; 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=20230601; t=1772027957; x=1772632757; 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=Zr1IMpBxPi2QmGUGN0kY17ZGeUT+drEE+wl3E5t2Ckw=; b=ndE4+ZP45MQPOChl/3A+wUO6Xhb3mbHVWdBuW1m46ZdzzS0JVax5qLTo5z8XwrK1/p thYSmhleKWCoS8cl2JjfvC1w/UMnVaGQriA0tytT/RQgrqFesQuPvb8NMHeNoYNsqYSq lofoSygDcwetZW/sil6LCCaLz8vQFEPdDw/ckUx55QYRH50ZZQ4WWQoExp2T4Z+moYUD oMPPGXLK7lu/Q2EQdQVfBKKOif3hxIabiIi3eZnRnyR5mMSTpVsnJ1GPSwqXrFk/+flw tNbeF4I9RShPJq4/4vu76DNyuxZ4lEeYQBtVAfI5BHZqU7X3X1iKtMvEFESgAGapBcJT TTjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772027957; x=1772632757; 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=Zr1IMpBxPi2QmGUGN0kY17ZGeUT+drEE+wl3E5t2Ckw=; b=XWs4NpTezqwAC092/JUWQMS87lfONbi/M7Wd5Sb4bFRtC5swQM89WZGfDHbxIBM+jN K92jtdmyxMbCdpeBekNdJ4U4nFRNeMSLPayPWFVnOaZIztaCP/CV4NW/AM4NzVarVc+t bXKtfevPVNbn+75BWcVI3lbCES6UdE+vbHbPeummaV7KoKm1hiTnSCn7lXrRKbUDUd6j Cyc5B0gjPNv74Gz3kVWm8abY8D58z+TxoTW/T2UQHvhiz3C4tzFq9j+Y4S2qpvwXVEWf iYmO+lNTaCVA83WRrZaBzH7IEUUBJUQI2mEcjiRL56HOHhF6FJT78svfJ/tZw3fT6qeI zszA== X-Forwarded-Encrypted: i=1; AJvYcCWr8tj66qTLlUEOipwjnPo6t5HCmJVvjLSUEsnFKeAWJlCzw+kRmXvr1K4gGkyXL4xPH0E+YQJo5sfu@lists.postgresql.org X-Gm-Message-State: AOJu0YwQ4Jr1XxodPXf+VnP+z2TYcA+dFOSh+n5UK28//l9V37+GkhiA Fmi4U0aDtXey9Dbx1AN0bLtgz+sbbpHPHSSj8bhEQre2q7ECREN/M7lpv5G1b65tTvMsnnAQd8q XBwItZVZPB2psZUGmEmB5yvGOX0hMC+Y= X-Gm-Gg: ATEYQzz/2/LycAP6eAcoQRlDPnmJYCP+hKsqCxEGYRBYBSN7FlUgk5KhzmSdb6BgPZm L4AUmcP1PN5i3u9T2o8dxAdNrY7CTERd0fpYNfh2iZOBXsuLHUpX7CH2PTLxiEI6U+lmJj1pBA6 GhGiwCnTozI+enOBZZj863KLPzIVQk2FO7C2+6iTAgiprEruj3xtuFx3RTv41ru3szjEuTrVq5i YZXNL7ftnbj57v+5Aq6+FKwtq7D9IHFf+RN1xOqFEe9lQKD/4tr7PZI8NuladYy5o3QY9Zfbhew XA10HQdaBDqUW4bc4r0fYab4ZlvfJHCIPFr+MUv0pHwzVLOarAI= X-Received: by 2002:a17:907:7211:b0:b88:4fc9:a196 with SMTP id a640c23a62f3a-b9081b23d0cmr1043008966b.34.1772027956403; Wed, 25 Feb 2026 05:59:16 -0800 (PST) MIME-Version: 1.0 References: <202502131716.7mgkcnrem2hn@alvherre.pgsql> <2939991.1740089974@sss.pgh.pa.us> In-Reply-To: <2939991.1740089974@sss.pgh.pa.us> From: Robert Haas Date: Wed, 25 Feb 2026 08:59:04 -0500 X-Gm-Features: AaiRm53tFRLAjAJ5AHBuWQK_KllZzpR5_wz0RDjHIVBy1F0h1GvBoB73nDgKEPw Message-ID: Subject: Re: Major Version Upgrade failure due to orphan roles entries in catalog To: Tom Lane Cc: =?UTF-8?Q?=C3=81lvaro_Herrera?= , Virender Singla , pgsql-bugs@lists.postgresql.org, Aniket Jha 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 On Thu, Feb 20, 2025 at 5:19=E2=80=AFPM Tom Lane wrote: > 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 recently learned of a case where this commit caused role grants to be erroneously emitted from the output of pg_dumpall. In the case in question, a v16 pg_dumpall was used against an older server. Hence, dump_grantors was false, and any generated GRANT commands would not have included in the grantor anyway. Nevertheless, this logic caused those grants to be skipped altogether: + if (PQgetisnull(res, i, i_grantor)) + { + /* translator: %s represents a numeric role OID */ + pg_log_warning("found orphaned pg_auth_members entry for role %s", + PQgetvalue(res, i, i_grantorid)); + done[i - start] =3D true; + --remaining; + continue; + } I don't think this logic makes sense. In pre-16 releases, we don't even try to maintain the grantor field properly. Consider this test case: create role foo; create role bar; create role baz createrole; set role baz; grant foo to bar; reset role; drop role baz; If you do this on v15 and then run v15's pg_dumpall, it will dump "GRANT foo to bar", with no GRANTOR clause due to the PQgetisnull() gating that logic. v16's pg_dumpall will dump nothing and emit a warning instead. Arguably, pre-v16 pg_dumpall shouldn't EVER be dumping the grantor since the grantorid could be an old role OID that has been recycled for a new role, and relying on that for anything security-critical seems like a mistake, but that behavior is also longstanding. But omitting the grant altogether seems like an overreaction. I understand that we need to do that when the *member* is invalid, of course; in that case, there's no alternative. But that's not the case for the grantor. --=20 Robert Haas EDB: http://www.enterprisedb.com