Dump roles on AWS without pg_dumpall -g access (postgresql 9.6.8)? We have a system on AWS RDS Aurora, PostgreSQL v 9.6.8 option.

We are trying to move its roles to a new encrypted 10.5 instance, but we don't have superuser access that's required to do pg_dumpall -g on the old instance. (I am aware of the update to Postgres 10.0 that lets you do this without superuser access, but this is 9.6.8).

Any ideas for a workaround? Thanks in advance for any suggestions whatsoever!
It turns out the 10.0 solution was backported (apparently) to 9.6.8, so:

pg_dumpall --host &lt;aws_endpoint&gt; --globals-only --no-role-passwords \
    --username masteruser &gt;roles.sql


Then run roles.sql against the new database.