Pg_restore: command not found

I have a RoR application hosted on Heroku using the Postgresql database and using the PG Backups tool to backup the database from my application to my local computer. Since the application is still under development, it helps me, from a programming point of view, to bring together the changes made by my colleagues to the database. I have successfully used PG Backups for capture and recovery for several months, but recently, when I run my typical commands, as shown here:

$curl -o latest.dump `heroku pgbackups:url --app XXXXX` $pg_restore --verbose --clean --no-acl --no-owner -h localhost -U XXXXX -d XXXXX_development latest.dump 

I get this error after running the curl command:

 -bash: pg_restore: command not found 

Any ideas on why this is happening? Obviously, the problem is that I cannot restore the downloaded backup.

+6
source share
1 answer

It seems like something has changed in your local environment, and now the pg_restore client command line tool associated with postgres next to pg_dump and psql is not available.

It looks like you need to configure PATH correctly.

Try to find the correct pg_restore on your system, perhaps sudo find / -name pg_restore , and after you add it to the PATH directory.

Finally, what you are doing can possibly be done with the simpler heroku pg:pull , which takes a backup from your heroku database and restores it locally all in one command (but also uses pg_dump / pg_restore, so they should be also available.

+7
source

Source: https://habr.com/ru/post/957947/


All Articles