refactoring a database owner without "reassign owned" - Mailing list pgsql-general

From Jeff Janes
Subject refactoring a database owner without "reassign owned"
Date
Msg-id CAMkU=1zz66h_NfnRPZdyWO=kaUeL6Vj5yJ9WcgMCZTNSoPhbwQ@mail.gmail.com
Whole thread Raw
Responses Re: refactoring a database owner without "reassign owned"
List pgsql-general
Let's say you have a database which is owned (as well as all the contents within it) by the postgres internal user.  

Having created or inherited a mess, how do you fix it?

database1=# REASSIGN OWNED BY postgres TO foo ;

ERROR:  cannot reassign ownership of objects owned by role postgres because they are required by the database system

Is there some way simpler than going through every object of every type and doing an "ALTER <TYPE> <OBJECTNAME> OWNER to..." ?

This is on 9.2.4, but I think it applies to all versions.

Cheers,

Jeff

pgsql-general by date:

Previous
From: Ray Stell
Date:
Subject: pg_upgrade -u
Next
From: Merlin Moncure
Date:
Subject: Re: Does it make sense to break a large query into separate functions?