I am new to Postgres and I am attempting to load/restore a Postgres database from a database dump file within Windows. When I attempt to do so I get the following error. Being new to Postgres I am not sure what the error means.
The command
C:\Users\myuser>psql --single-transaction newdatabasename --file="C:\path\to\database-dump-file.sql"
the error
psql: fatal: -1 can only be used in non-interactive mode
I entered the command in the windows command shell where the path the Postgres BIN
directory is included in the PATH
. What is this error referring to? Do I need to be in the SQL Shell (psql) to execute this command? A Google search seems to indicate it may have something to do with authenticating with a password.
On Windows, the option parsing library stops parsing arguments once the first non-option argument is encountered. That means the file argument is not seen, so it thinks you are in interactive mode.
You need to put newdatabasename
at the end of the command line, not in the middle.