How to close connection using psql when executed from shell script
How to close connection using psql when executed from shell script
If you run
psql -c '/* SQL statement */'
or
psql -f script.sql
the connection will automatically be closed as soon as the command is done