A dump from one server often fails on another with a pile of role does not exist errors. The reason is that the dump says which role owns each object, and that role isn’t there.
pg_dump -O -x -f mydb.sql mydb
psql -X -d newdb -f mydb.sql
-O (--no-owner) skips the commands that set ownership. By default pg_dump writes ALTER OWNER or SET SESSION AUTHORIZATION statements, which fail unless the script is run by a superuser or the owner of everything. With -O the user who runs the script becomes the owner of all objects. -x (--no-privileges, also spelled --no-acl) leaves out the GRANT and REVOKE commands.
For the archive formats there is a catch. The docs say -O is ignored when pg_dump writes an archive, and that you give the option to pg_restore instead:
pg_restore --no-owner --no-privileges -d newdb mydb.dump
I’d only use this for moving a database to a setup where roles differ, such as a test copy. For a real restore on the same system you usually want the owners and permissions back, and dropping the GRANT lines means you have to set access up again by hand.
Further reading: pg_dump, pg_restore