admin@usachurch.com writes:
> pg_restore -U admin -c /home/postgres/staging-dump
> Now, although tons of data is now streaming to my monitor, when it is
> done, none of the new data is in the backup's staging db.
The default behavior of pg_restore is to emit SQL commands onto stdout,
which of course is not going to do a lot for your backup DB. What you
probably want is to include a "-d database" switch to tell it to connect
to a database and send the commands there.
> So, I tried doing this variation:
> pg_restore -U admin -C -d staging /home/postgres/staging-dump
> pg_restore: [archiver (db)] could not execute query: ERROR: database
> "staging" already exists
-C tells it to create (and then connect to) the target DB, rather than
connect to an existing DB and restore into that. So generally you want
to say "-d template1" (or some other existing DB) when you use -C.
regards, tom lane