Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Add option to override owner #24

Open
nnutter opened this issue Nov 8, 2014 · 1 comment
Open

Add option to override owner #24

nnutter opened this issue Nov 8, 2014 · 1 comment

Comments

@nnutter
Copy link
Contributor

nnutter commented Nov 8, 2014

We could support specifying an owner when creating a database from a template other than template1 that would reassign ownership of existing objects to that owner. This also implies that --owner and --based-on do not need to be mutually exclusive.

The owner of a database can be looked up with:

SELECT rolname FROM pg_database JOIN pg_authid ON pg_database.datdba = pg_authid.oid WHERE pg_database.datname = 'template1';

The owner can be reassigned with:

REASSIGN OWNED BY postgres TO genome;
@nnutter
Copy link
Contributor Author

nnutter commented Nov 12, 2014

#31 addresses most of this but does not address reassigning ownership of all objects, only the database.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant