Migrating from one role to another can be very confusing in Postgres. This is a personal guide with a collection of queries to help aid in this effort.
old_role
-- Refers to a postgres role that currently owns objects.new_role
-- Refers to a postgres role that will soon own previous objects.postgres
-- Refers to the admin user role.role_database
-- Refers to a database that theold_role
currently owns but will soon be owned bynew_role
See all the tables a given role in a db owns: