Cant pg_restore on Heroku: "could not read from input file: end of file"
There appears to be an issue with piping to the file. I created the dump using the -f command to specify the file and that solved my issue.
pg_dump -f mydb.dump -Fc --no-acl -no-owner -h localhost -U myUser --schema=public myDatabase
Just experienced this problem, I wasn't able to get it to work with the answers provided here, but changing the extension of the output file to .psql
managed to fix it for some reason
pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.psql
I failed to load the dump in the exact described above way, BUT i've come to another solution which worked fine for me:
Make the dump in simple SQL format:pg_dump --no-owner mydb > mydb.dump
You may need to switch to the user who has rights to access your DB, postgres
for example. So, sudo su postgres
and then make the dump.
And then load it with psql
tool:user@pc:~/path/to/your/dump$ heroku pg:psql < mydb.dump