Re: How to drop user if objects depend on it

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:50:22
Message-ID: F57C7C4919884A3A9ECD9591007F17DE@dell2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> 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

How to to delete user ?

Andrus.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Geoghegan 2015-10-07 16:52:39 Re: Issues with german locale on CentOS 5,6,7
Previous Message Jerry Sievers 2015-10-07 16:48:47 Re: Ynt: How to drop user if objects depend on it