pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Drop role cascade ?
Date: Fri, 18 Nov 2022 00:13:24 -0600
Message-ID: <c744908b-befc-07fc-1e3b-d0329cd6d83f@gmail.com> (raw)
In-Reply-To: <CAEs=6D=z_1f_FNS6NxYOpS-M8HrrKLmSoM=UY3yA6dznOivt0Q@mail.gmail.com>
References: <CAEs=6D=z_1f_FNS6NxYOpS-M8HrrKLmSoM=UY3yA6dznOivt0Q@mail.gmail.com>

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.





view thread (8+ messages)

Message-ID: <c744908b-befc-07fc-1e3b-d0329cd6d83f@gmail.com>
Permalink:  ../c744908b-befc-07fc-1e3b-d0329cd6d83f@gmail.com/
Also on:    postgresql.org/message-id/c744908b-befc-07fc-1e3b-d0329cd6d83f@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: Drop role cascade ?
  In-Reply-To: <c744908b-befc-07fc-1e3b-d0329cd6d83f@gmail.com>
  References: <CAEs=6D=z_1f_FNS6NxYOpS-M8HrrKLmSoM=UY3yA6dznOivt0Q@mail.gmail.com> <c744908b-befc-07fc-1e3b-d0329cd6d83f@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox