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 from postgres and connect to test
- Upload data into database
Of course check who is owner of postgres database – in most cases you have to run this as user ‘postgres’.