drop role with privileges

From: "Tom Darci" <tom(at)nuws(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: drop role with privileges
Date: 2006-12-09 23:40:44
Message-ID: A70D5EAEADAEB6438A262830763338A964AB68@MI8NYCMAIL16.Mi8.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hey All-

It seems like there should be an easily-found answer to this, but if
there is, I can't find it.

I am simply trying to drop a role.

So, before dropping it I need to reassign all its owned objects
(REASSIGN OWNED, very handy) and then revoke all privilges it has had
assigned to it. The revoking privileges is the hard part. (And why this
requirement?) I can (and have been) explicitly revoking all privileges
on each database object first, but that's a lot of unneccessary work
(and time... it's done programatically though, of course).

I've been looking into using the function aclcontains() in conjunction
with the table pg_class, in order to determine which objects a role has
been granted privilges to. And while this seems promising, I'm still not
having any luck formulating the sql to get me the answer to: "What
objects has role x been granted specific rights to?"

We are using 8.2.

Any help is much appreciated.

Regards,
-Tom D

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2006-12-10 00:07:44 Re: drop role with privileges
Previous Message brian 2006-12-09 23:22:49 ALTER TABLE RENAME and primary key