I backed up a database called
app_data, on a 9.3 server, with this basic command:
pg_dump -n public -F custom app_data > app_data.pg.dump
Then I try to restore it on another server (running 9.4) like this:
pg_restore -C -d postgres app_data.pg.dump
But it puts all the tables in the
postgres database. The man page says it will create and use a new database,
Create the database before restoring into it. [...]
When this option is used, the database named with -d is used only to issue the initial DROP DATABASE and CREATE DATABASE commands. All data is restored into the database name that appears in the archive.
That's not what it's doing. The name in the archive is
bash-4.2$ pg_restore -l app_data.pg.dump ; ; Archive created at Tue Dec 15 04:16:52 2015 ; dbname: app_data ...
Am I doing something wrong?