I'm somewhat new to postgres and having trouble with restoring a local database with backup data using pg_restore
and hoping to get some help. My situation is as follows:
postgres_db
user name postgres
and port 5432
.fdb
fprod
on my local PC (mac if it matters) that contains a bunch of .dat.gz
files inside.Now I navigate to this backup folder and in my local terminal I run this:
pg_restore -h postgres_db -p 5432 -U postgres -d fdb -f fprod
And I get the following error message below. I've tried changing my hostname to just -h localhost
but no difference.
pg_restore: error: options -d/--dbname and -f/--file cannot be used together
What am I missing and doing wrong? Please advise.
As documented in the manual -f
does not specify the input file, it specifies an output file e.g. for the --list
command.
So you need:
pg_restore -h postgres_db -p 5432 -U postgres -d fdb fprod