Re: Eliminando un rol

From: Marcos Ortiz <mlortiz(at)uci(dot)cu>
To: Dairon <ddvega(at)uci(dot)cu>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Eliminando un rol
Date: 2012-10-11 20:25:32
Message-ID: 50772B3C.3020209@uci.cu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda


On 10/11/2012 04:15 PM, Dairon wrote:
> Hola a todos, necesito saber cual es la forma correcta de eliminar un
> rol que tenga permisos ya configurados. Es que al ejecutar la consulta
> "drop role pepe;" me sale el siguente error:
>
> ERROR: role "pepe" cannot be dropped because some objects depend on it
> DETAIL: 1 object in database Prueba
>
> Necesito poder borrar el role sin tener que ir objeto por objeto
> eliminando los permisos del mismo.
Si quieres hacer esto, debes ejecutar un REASSIGN OWNED BY old_role [,
...] TO new_role primero, y luego haces el DROP ROLE
En la documentación dice esto:

"DROP ROLE removes the specified role(s). To drop a superuser role, you
must be a superuser yourself; to drop non-superuser roles, you must have
CREATEROLE privilege.

A role cannot be removed if it is still referenced in any database of
the cluster; an error will be raised if so. Before dropping the role,
you must drop all the objects it owns (or reassign their ownership) and
revoke any privileges the role has been granted. The REASSIGN OWNED and
DROP OWNED commands can be useful for this purpose."

http://www.postgresql.org/docs/9.2/static/sql-droprole.html
Saludos
>
> Al tanto. Gracias de antemano.
>
>
>

--

Marcos Luis Ortíz Valmaseda
*Data Engineer && Sr. System Administrator at UCI*
about.me/marcosortiz <http://about.me/marcosortiz>
My Blog <http://marcosluis2186.posterous.com>
Tumblr's blog <http://marcosortiz.tumblr.com/>
@marcosluis2186 <http://twitter.com/marcosluis2186>

10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS...
CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION

http://www.uci.cu
http://www.facebook.com/universidad.uci
http://www.flickr.com/photos/universidad_uci

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2012-10-11 20:36:21 Re: Eliminando un rol
Previous Message Dairon 2012-10-11 20:15:50 Eliminando un rol