Closing postgres connection using psql when executed from shell script

Viewed 305

How to close connection using psql when executed from shell script

1 Answers

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

Related