Re: How to drop user if objects depend on it

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: How to drop user if objects depend on it
Дата
Msg-id 5615546A.9060708@aklaver.com
обсуждение исходный текст
Ответ на Re: How to drop user if objects depend on it  ("Andrus" <kobruleht2@hot.ee>)
Список pgsql-general
On 10/07/2015 09:50 AM, Andrus wrote:
>>> 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.
>> In general, REASSIGN OWNED has to be done by a role that has privileges
>> of (is a member of) both the source and target roles.  Superusers are
>> considered members of all roles, so that's how come it works for them.
>
> I tried as superuser:
>
> reassign owned by farukkugay to postgres;
> ALTER DEFAULT PRIVILEGES IN SCHEMA public,firma2 revoke all ON TABLES
> from farukkugay;
> drop user farukkugay ;
>
> but got error
>
> ERROR: role "farukkugay" cannot be dropped because some objects depend
> on it
> SQL state: 2BP01
> Detail: privileges for schema public


Above you revoked DEFAULT PRIVILEGES which applies to objects created in
future. You still probably have PRIVILEGES assigned to farukkugay on the
public schema. So in psql do:

\dn+ public

>
> How to to delete user ?
>
> Andrus.


--
Adrian Klaver
adrian.klaver@aklaver.com


В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: using postgresql for session
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: postgres standby won't start