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 1vO3Tv-007tYE-0B for pgsql-general@arkaria.postgresql.org; Wed, 26 Nov 2025 00:34:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vO3Tt-00CvoN-0q for pgsql-general@arkaria.postgresql.org; Wed, 26 Nov 2025 00:34:01 +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 1vO3Ts-00CvoF-30 for pgsql-general@lists.postgresql.org; Wed, 26 Nov 2025 00:34:01 +0000 Received: from mail-yw1-x112c.google.com ([2607:f8b0:4864:20::112c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vO3Tq-001TrI-1n for pgsql-general@lists.postgresql.org; Wed, 26 Nov 2025 00:34:00 +0000 Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-787eb2d8663so6465097b3.0 for ; Tue, 25 Nov 2025 16:33:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764117239; x=1764722039; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=h8Gix7CqiKGPhMhsrDWc0qhDefaQc/YpRZGiSzmjbWM=; b=hBEk3ouYaaf9CNTE8Q/YWoUNMtpZIGNTh4QbTIN7MvB/NFjQ7jeUa75rvrulqFD8dp b3AJTIef4qgflBx2p6BHmBierjITq/iab3EFV5kmTAS1u8aZh8GrWF937jkoGvZil3wk 9iiM/1MRuf/ncazYqThV/kltGp744H1Q2nLWA0rhnXlQNqkk8PVJDC4F5EsQof8YwjaM W5ivVBhk9yXvKGR3yzu3MgfGR8ofbiDEog8toN+sLOZBFyeqykhfsiwgfOrv2zA6jKHN O4tAuoHb1jQp7Dg34CDegtUxz/InS267pjo4OhuCm9YKEVUom3JEgsmn2ITCfm4B2v2L Mp8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764117239; x=1764722039; h=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=h8Gix7CqiKGPhMhsrDWc0qhDefaQc/YpRZGiSzmjbWM=; b=Udp5EEP85wdL7Xm1ipOj9rnNYwBxhNfLsV+lwb3c9AFxbK0Qskqek9UGeGDqZhefTR JXkLetiggCNVtFzwflpgUkl/rF7u39x7T+TwoRnaAmjf8eiEQ+Y0xwY9A2zopjWh4F0U XCZ861hXwrIcTsgTyKMChjY2t+AspZsNJroMpkCgAzo81JfnLWELTr5V773oO2nnlsEx lQQnHIgGBElY98PlvBbWYdYxi2QK6sDpeeKIh4NnNWIFEjcX2s2KLXKurn01qFVg1Lgt q+TTDDjnSv3vxy4R6ubCdR4WnxJWAWcs3WXLarev1cI/nrOfoLys7SoURoZ/TbgSJuXz eRWg== X-Forwarded-Encrypted: i=1; AJvYcCW9N04iXIAigIz9DKwtAeyRVroYN/KaO8OzTOWMmFbLd6R7ZZAt45k1rq8IgXOaq9PpvVtM9C0rWadreuxo@lists.postgresql.org X-Gm-Message-State: AOJu0YyH1cboX/jfLwr8O3QiwwR/V+bbjb0iEPvl84l1PgPUFjRt49I8 vuCa213J4Q7+SNuDQSghBAxPJOPFuWjbHPO3TroprlxH6PL9h8IXRDxUncfocP8T9V3laWntjrR 9jRmkHkpK9FLCHaqOF9kWrFAY7f4GhZE= X-Gm-Gg: ASbGncv48Mtmc/jAPNRCGNb1QY6s9P42t6Hlz8nz5dKdEzAdgk+eTtaxH6q0zL4kMn5 pSpb2Iime4nZ4BU2rzOTXnycquinFc8WucNah7GRrHWc2gw0WSFeMj9pElPGcXkY9ZIhfjGbcwa XC2N3zP9X9hU9ISOmP2lgOV1v6bXD7pKS8dWaiIjDqXiq8zgGXxoV4eCpJdqaElowq0XbUVk5kc JCGAw4TLy8u5NuVtGpw7roUJHvjTE9iLdXGWVibkWjNhxE0b84zYtBieddqXEZ5x28p4F4y X-Google-Smtp-Source: AGHT+IHjDRhCUw0WCMfhTZcWJjnyte1bWjIe+LO0+X9ofm1CJ6xmfNg4EowfUh7mV4SYMYgJzugB//84IlQXSSNJGsE= X-Received: by 2002:a05:690c:fc9:b0:786:5d0a:c273 with SMTP id 00721157ae682-78a7bb9cc90mr184066237b3.23.1764117238483; Tue, 25 Nov 2025 16:33:58 -0800 (PST) MIME-Version: 1.0 References: <1484313.1764115685@sss.pgh.pa.us> In-Reply-To: <1484313.1764115685@sss.pgh.pa.us> From: immerrr again Date: Wed, 26 Nov 2025 01:33:47 +0100 X-Gm-Features: AWmQ_bniD9LrQaWYpc16xJBZBdBJOezJgsYb9rMY8KSbJXZzfA_XWXXghl4Q6WY Message-ID: Subject: Re: DROP ROLE blocked by pg_init_privs To: Tom Lane Cc: Pavel Luzanov , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000578efe0644748d49" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000578efe0644748d49 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Tom, On Wed, Nov 26, 2025 at 1:08=E2=80=AFAM Tom Lane wrote: > The missing step here is > > DROP OWNED BY test_role; > ... > See discussion here: > ... I had gone through that thread before posting, and yes, I mentioned "DROP OWNED BY" in my original message. Is this what everyone is doing these days? People just make sure there are no pg_depends/pg_shdepends that need transferring, and then just blast the rest with "DROP OWNED BY"? It just makes me uneasy to run a command with such potential for data loss in order to remove a role. So much so that I have written a couple of queries to manually clean up the system tables pg_init_privs/pg_shdepends instead (see [1]). They seem to unblock dropping the role for now, but I'm not even sure if I have missed something, or for how long they will keep working. I guess, my question is shouldn't there be a "REVOKE INITIAL ... FROM " command to drop just the initial privilege(-s) without potentially nuking everything else owned by that user? Thanks 1. https://www.postgresql.org/message-id/CAERznn-SBBqQ3YcdZk9U4mqVQPsVgLisi%3D= EdFzY5Fb7hOQ4g_Q%40mail.gmail.com --000000000000578efe0644748d49 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Tom,

On Wed, Nov 26, 2025 at 1:08=E2= =80=AFAM Tom Lane <tgl@sss.pgh.pa.u= s> wrote:
> The missing step here is
>=C2=A0> DROP OWNED BY test_role;
> ...
> See discussion here:<= div>> ...

I had gone through that thread before posti= ng, and yes, I mentioned "DROP OWNED BY" in my original message. = Is this what everyone is doing these days? People just make sure there are = no pg_depends/pg_shdepends that need transferring, and then just blast the = rest with "DROP OWNED BY"?

It just= makes me uneasy to run a command with such potential for data loss in orde= r to remove a role. So much so that I have written a couple of queries to m= anually clean up the system tables pg_init_privs/pg_shdepends instead (see = [1]). They seem to unblock dropping the role for now, but I'm not even = sure if I have missed something,=C2=A0or for how long they will keep workin= g.

I guess, my question is shouldn't there be = a "REVOKE INITIAL ... FROM <user>" command to drop just the= initial privilege(-s) without potentially nuking everything else owned by = that user?

Thanks

--000000000000578efe0644748d49--