Re: How to drop user if objects depend on it

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: "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 12:12:38
Message-ID: 1A68A966BDE142FEABFE8BDE2D86261D@dell2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

REASSIGN OWNED BY vantaa TO postgres;

and

REASSIGN OWNED BY vantaa TO idd_owner;

but got error

permission denied to reassign objects .

How to fix ?

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

Andrus.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2015-10-07 13:25:25 Re: Issues with german locale on CentOS 5,6,7
Previous Message Thom Brown 2015-10-07 11:39:41 Re: How to drop user if objects depend on it