Re: How to drop user if objects depend on it

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Andrus <kobruleht2(at)hot(dot)ee>, Thom Brown <thom(at)linux(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to drop user if objects depend on it
Date: 2015-10-07 13:53:06
Message-ID: 561523C2.4040309@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/07/2015 05:12 AM, Andrus wrote:
> Hi!
>
>> The objects can't be owned by nothing, so you will need to reassign
>> ownership:
>> REASSIGN OWNED BY old_role TO new_role;
>> e.g.
>> REASSIGN OWNED BY vantaa TO postgres;
>> Then you can drop the role.
>
> User who deletes other users is not superuser. It is created using
>
> CREATE ROLE admin LOGIN
> NOSUPERUSER INHERIT CREATEDB CREATEROLE NOREPLICATION CONNECTION LIMIT
> 100;
> GRANT idd_owner TO admin;
>
>
> I tried

So to be clear admin is doing the below, correct?

>
> REASSIGN OWNED BY vantaa TO postgres;
>
> and
>
> REASSIGN OWNED BY vantaa TO idd_owner;
>
> but got error
>
> permission denied to reassign objects .

Is the above a blanket error or does it mention specific objects?

>
> How to fix ?

What you are trying to do is reverse what you did to get the present
setup. Do you have a record/script that shows what you did to create the
role and assign it to the objects?

>
> I can add some rights to user who invokes this command if this helps.
>
> Andrus.
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2015-10-07 13:57:13 Re: How to drop user if objects depend on it
Previous Message Hellmuth Vargas 2015-10-07 13:46:05 Re: ayuda con funcion List