Re: How to drop user if objects depend on it

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrus" <kobruleht2(at)hot(dot)ee>
Cc: "Thom Brown" <thom(at)linux(dot)com>, "Adrian Klaver" <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to drop user if objects depend on it
Date: 2015-10-07 16:45:43
Message-ID: 32078.1444236343@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I wrote:
> "Andrus" <kobruleht2(at)hot(dot)ee> writes:
>> ALTER DEFAULT PRIVILEGES IN SCHEMA public,firma1 GRANT all ON TABLES TO
>> vantaa;

> I am not sure that REASSIGN OWNED will get rid of default-privilege
> specifiers --- you might have to reverse this step separately.

A little further review shows that DROP OWNED is the way to get rid of
leftover privileges. So in general you need to do REASSIGN OWNED to move
the ownership of objects, then DROP OWNED to get rid of privileges granted
on non-owned objects, before you can drop a role.

This is documented, but only in passing in the REASSIGN OWNED man page.
I think it needs to be explained more prominently. Will see about making
that happen.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jerry Sievers 2015-10-07 16:48:47 Re: Ynt: How to drop user if objects depend on it
Previous Message Melvin Davidson 2015-10-07 16:23:02 Re: How to drop user if objects depend on it