heroku pg:pull password authentication failed
Apparently it's possible to set the environment variables PGUSER and PGPASSWORD, as described here.
However, this won't work on windows in the given syntax. To do this on windows run the following:
SET PGUSER=[pg_username]
SET PGPASSWORD=[pg_password]
after entering these two lines Postgres will log you in with the given authentication info, instead of trying to sign in with the windows username
I've run into this problem a lot when running heroku pg:pull
. The issue in my case was that the pg:pull
command only works if my local PostgreSQL server has a password set.
To set a password, run psql localdb
and execute this SQL:
ALTER USER my_user_name with password 'my_new_password';
(You won't necessarily be required to use this password all the time. Run psql localdb
and see whether you're prompted; in my case, I can still log in to psql without the password.)
Now run heroku pg:pull --app my_heroku_app POSTGRESQL_COLOR localdb
, and enter your new password (twice) when prompted.