I'm trying to pg_dump certain schemas from my Heroku-hosted PSQL database into a local file.
Heroku provides me a DATABASE_URL
in the form
# postgres://username:password@host:port/database
postgres://abcde:wxyz@ec2-21-82-72-112.compute-1.amazonaws.com:5762/riza3dj029012
Based on the above I tried dumping some schemas -
> pg_dump --username=abcde --host=ec2-21-82-72-112.compute-1.amazonaws.com --port=5762 --dbname=riza3dj029012 --create --schema=my_schema --password > ~/pg_dump.dmp
> password: (enter password)
Is there any way to provide the password as a flag so I don't have to type it in manually? I want to automate this in a script.
I know --no-password
exists, but not sure what use that is, because it just prevents prompting for a password and then authentication (obviously) fails.
Thanks!