Psql databasename < file.db is the recommended method to import to a database. This doesn't work why?
closed as unclear what you're asking by Vérace, Paul White♦, Michael Green, Colin 't Hart, RolandoMySQLDBA Apr 3 '15 at 18:20
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
You are possibly not creating the database before attempting to restore it. From here,
24.1.1. Restoring the Dump
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
psql dbname < infile where infile is the file output by the pg_dump command. The database dbname will not be created by this command, so you must create it yourself from template0 before executing psql (e.g., with createdb -T template0 dbname). psql supports options similar to pg_dump for specifying the database server to connect to and the user name to use. See the psql reference page for more information.
Note the part which says
"you must create it yourself from template0 before executing psql (e.g., with createdb -T template0 dbname)".