Re: How to drop user if objects depend on it - Mailing list pgsql-general

From Andrus
Subject Re: How to drop user if objects depend on it
Date
Msg-id 1A68A966BDE142FEABFE8BDE2D86261D@dell2
Whole thread Raw
In response to Re: How to drop user if objects depend on it  (Thom Brown <thom@linux.com>)
Responses Re: How to drop user if objects depend on it  (Adrian Klaver <adrian.klaver@aklaver.com>)
List 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.



pgsql-general by date:

Previous
From: Thom Brown
Date:
Subject: Re: How to drop user if objects depend on it
Next
From: Tom Lane
Date:
Subject: Re: Issues with german locale on CentOS 5,6,7