Best way to list a role’s owned objects?

From: Felipe Gasper <felipe(at)felipegasper(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Best way to list a role’s owned objects?
Date: 2014-07-01 18:08:04
Message-ID: 53B2F904.5030801@felipegasper.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

What is the best way to list a role’s owned objects in any database?

My problem is that I need to be able to “FORCE DROP ROLE” by taking any
objects that that role owns, in any database, and reassigning them to
the “postgres” user.

Even if REASSIGN OWNED BY worked for this purpose (it only works on the
current database), I would still need a way to display to the API caller
which objects were reassigned.

Oh, and this preferably needs to work all the way back to PostgreSQL
8.1. :-<

Any ideas?

Thanks!

-Felipe Gasper
Houston, TX

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2014-07-01 18:13:16 Re: Best way to list a role’s owned objects?
Previous Message David G Johnston 2014-07-01 17:28:14 Re: how to create a role with no privileges?