dimitry_n
dimitry_n

Reputation: 3019

Heroku: running pg_restore from a local file returns errors

I am trying to load test db from a file store locally (db.sql), using

heroku run pg_restore -d foo db.sql

the error message I am getting says:

Error: You must install at least one postgresql-client-<version> package.

I tried to do sudo apt-get postgresql-client-9.4.1, and get:

bash: sudo: command not found

and without sudo, I get:

E: Invalid operation postgresql-client-9.4.1

Upvotes: 0

Views: 325

Answers (1)

Chris Peters
Chris Peters

Reputation: 18090

You need to use a locally-installed pg_restore to restore your data into the Heroku-hosted database.

I usually run something like this:

pg_restore --verbose --clean --no-acl --no-owner -h [host address] -p [port] -U [username] -d [name] [file path]

More info here: PostgreSQL Backup and Restore Commands

Upvotes: 2

Related Questions