Thread: how drop a role that owns stuff ?
Hi, for some cleaning up I'd like to drop a certain role. Now DROP ROLE yields an error and complains about 271 objects being owned by this role. Is there an easy way to switch ownership of those objects to another role? At least, is there a way to store those dependencies as a file? The contents of the 4th tab of the role-object in pgAdmin would be nice but I cant save it or copy it out. It lists which objects depend on the role. regards ...
Andreas wrote: > Hi, > for some cleaning up I'd like to drop a certain role. > Now DROP ROLE yields an error and complains about 271 objects being > owned by this role. > > Is there an easy way to switch ownership of those objects to another role? Yes, see REASSIGN OWNED (gives ownership to something else) and DROP OWNED (drops grants and removes objects owned). Normally you run both in that order. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.