I am getting syntax error at or near "pg_restore":
pg_restore -i -h localhost -p 5432 -U postgres -d old_db -v
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With