Re: DROP ROLE dependency tracking ... - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: DROP ROLE dependency tracking ...
Date
Msg-id 20080525125649.GC24891@alvh.no-ip.org
Whole thread Raw
In response to DROP ROLE dependency tracking ...  (Hans-Juergen Schoenig <postgres@cybertec.at>)
Responses Re: DROP ROLE dependency tracking ...  (Hans-Juergen Schoenig <postgres@cybertec.at>)
List pgsql-hackers
Hans-Juergen Schoenig wrote:

> test=# create role xy LOGIN;
> CREATE ROLE
>
> test=# grant connect on database test to xy;
> GRANT
>
> test=# drop role xy;
> ERROR:  role "xy" cannot be dropped because some objects depend on it
> DETAIL:  access to database test
>
> this is a totally fresh instance --- all i did was creating a db called  
> "test".
> failing would make sense if i would the owner of an object but i fact i  
> don't own anything.

But in some cases you might not want to lose the information associated
to the grants you've done.  That's why we have REASSIGN OWNED.

Hmm, but then there's no way to lose it, even if you do want that.  DROP
OWNED does not touch grants (which is per design), but we don't have
DROP ROLE CASCADE.  So maybe there's a functionality gap here ...

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: Hans-Juergen Schoenig
Date:
Subject: Re: [PATCHES] WITH RECURSIVE patch V0.1
Next
From: Hans-Juergen Schoenig
Date:
Subject: Re: DROP ROLE dependency tracking ...