Transferring role from one host to another:
Transfer role grants from one host to another
pg_dumpall -r -h source_host |> roles. sql
psql -h destination_host -f roles.sql
Transfer role grants from one host to another
pg_dump -h source_host -s | egrep '(GRANT|REVOKE)' > grants,sql
psql -h destination_host -f grants.sql