To run psql
without prompting password, you need to create $HOME/.pgpass
file like below with correct file permission 600
:
# host:port:database:username:password
localhost:5432:*:postgres:postgres
Update it with corrent values and there you go!