Re: REVOKE ALL ON ALL OBJECTS IN ALL SCHEMAS FROM some_role?

From: "DINESH NAIR" <Dinesh_Nair(at)iitmpravartak(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: REVOKE ALL ON ALL OBJECTS IN ALL SCHEMAS FROM some_role?
Date: 2025-07-08 19:54:16
Message-ID: PN4P287MB4381820CA5AB37F3FE9CBDAA9C4EA@PN4P287MB4381.INDP287.PROD.OUTLOOK.COM
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

When we create a role ,it has no inherent dependencies on other database objects. It's a standalone entity until we perform:

*
Grant it privileges on tables, databases, functions, etc.
*
Make it a member of other roles.
*
Assign ownership of objects to it.

So, when we execute cascade option for role then >> drop role .. Cascade then impact will be high

It will drop all objects owned by the role: This is the most significant effect. It will drop tables, views, sequences, functions, schemas, and any other database objects that the role owns.

Revokes all privileges granted to the role: Any GRANT statements that gave permissions to role_name will be undone.

Removes the role from any roles it is a member of.

Removes any roles that are members of role_name from role_name.

Thanks

Dinesh Nair

________________________________
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Sent: Tuesday, July 8, 2025 6:47 PM
To: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: REVOKE ALL ON ALL OBJECTS IN ALL SCHEMAS FROM some_role?

Caution: This email was sent from an external source. Please verify the sender’s identity before clicking links or opening attachments.

Ron Johnson <ronljohnsonjr(at)gmail(dot)com> writes:
> Cascading statements really need a DRY RUN option.

[ shrug ] BEGIN/ROLLBACK serves that purpose fine, in fact better
than a per-statement "dry run" option would do: you can run several
dependent DDL statements and then look around at the results before
committing (or not).

Your claim that rollback is slow seems to be born of experience with
some other DBMS.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2025-07-08 20:22:41 Re: REVOKE ALL ON ALL OBJECTS IN ALL SCHEMAS FROM some_role?
Previous Message Tom Lane 2025-07-08 13:17:57 Re: REVOKE ALL ON ALL OBJECTS IN ALL SCHEMAS FROM some_role?