Sample Header Ad - 728x90

Why isn't pg_restore --create working?

1 vote
2 answers
828 views
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, app_data. > -C --create > 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 app_data: 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?
Asked by Rob N (111 rep)
Dec 15, 2015, 04:47 AM
Last activity: May 8, 2025, 09:02 PM