I was told there's a way to perform a 'pg_dump' that will also eliminate the need for me to create the database again before restoring the dump with 'pg_restore'. I've read the PostgreSQL manual and it says:

Code:
pg_dump dbname > outfile
That's a standard pg_dump which still requires me to create the database & associated roles before restoring.

Then it says:

24.1.1. Restoring the Dump

The text files created by pg_dump are intended to be read in by the psql program. The general command form to restore a dump is
Code:
psql dbname < infile
So my question is why does it recommend psql to restore the pg_dump file? It seems that restoring from a text method isn't good practice, no?

And how can I perform a pg_dump and not need to create the database before the pg_restore process?