pg_restore with -C option does not create the database
Exactly like @Eelke said – you’ve got in file wrote ‘create database’ so this database does not exist when you’re running script… That’s what for there is always ‘postgres’ database. Try this: pg_restore -C -d postgres -v -h xxhostxx -p 5432 -U xxuserxx test_pg_dump.dmp** And this should: connect to postgres database Create test database Disconnect … Read more