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:postgresUpdate it with corrent values and there you go!