REVOKE ALL ON ALL OBJECTS IN ALL SCHEMAS FROM some_role?

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: REVOKE ALL ON ALL OBJECTS IN ALL SCHEMAS FROM some_role?
Date: 2025-07-08 11:52:11
Message-ID: CANzqJaDu+7q9i=-vwUsX-ZZRTKSCCCG7FVF32X7XhPo1E4Xpxg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

REASSIGN OWNED is great, but "DETAIL: privileges for ..." is also a cause
for DROP ROLE to fail.

Thus (via a script, of course, that loops through every database and every
schema in that database, and for every object you can grant to), I've got
to REVOKE ALL ON {object type} IN SCHEMA ... FROM some_role, then REVOKE
ALL ON SCHEMA ... FROM some_role.

Is there a single command that I'm missing?

(Yes, I know privileges should be granted to groups. The archaic some_role
which I just dropped is a group role.)

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Ribe 2025-07-08 12:16:11 Re: REVOKE ALL ON ALL OBJECTS IN ALL SCHEMAS FROM some_role?
Previous Message Kouber Saparev 2025-07-07 12:47:06 pg_combinebackup failure