Reputation: 51
I am getting syntax error at or near "pg_restore":
pg_restore -i -h localhost -p 5432 -U postgres -d old_db -v
Upvotes: 3
Views: 6281
Reputation: 1735
From: https://www.reddit.com/r/PostgreSQL/comments/e6ezai/getting_a_syntax_error_when_trying_to_restore/
That means you are running pg_restore from within psql. But pg_restore is a command line program (not a SQL command) just like psql.exe (or createdb.exe or cmd.exe) so you need to run that on the command line, not within psql.
Upvotes: 3