psql: Run commands in batch mode
For batch operation I generally use:

psql -v ON_ERROR_STOP=1 -P pager=off --single-transaction


... however, generally psql should detect that stdout is not a terminal and automatically turn pager off if you're redirecting its stdout.