Re: Drop role cascade ?

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Drop role cascade ?
Date: 2022-11-18 06:13:24
Message-ID: c744908b-befc-07fc-1e3b-d0329cd6d83f@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/17/22 17:07, David Gauthier wrote:
> psql (11.5, server 11.3) on linux
>
> Someone who had privileges in a lot of tables/schemas/DBs left the
> company.  I want to drop that role but "rop role xxx" won't let me
> because...  "xxx cannot be dropped because some objects depend on it".
>
> Is there a way to just get rid of this role without revoking xxx in all
> the individual DB objects he has privs too?  Something like "drop role xxx
> cascade" ?

Had this idea tonight about how to find what is owned by a specific role. 
Haven't tested it, so the syntax might be a bit wrong, and it might not work:

$ pg_dump --schema-only $DATABASE | grep OWNER | grep $OLDEMPLOYEE

--
Angular momentum makes the world go 'round.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2022-11-18 10:11:25 Re: Calculating average block write time
Previous Message Andreas Kretschmer 2022-11-18 05:34:06 Re: Drop role cascade ?