How can I call psql so that it doesn\'t prompt for a password?
This is what I have:
psql -Umyuser < myscript.sql
This also works for other postgresql clis for example you can run pgbench in non-interactive mode.
export PGPASSWORD=yourpassword /usr/pgsql-9.5/bin/pgbench -h $REMOTE_PG_HOST -p 5432 -U postgres -c 12 -j 4 -t 10000 example > pgbench.out 2>&1 &