14th September 2023: PostgreSQL 16 Released!
Unsupported versions: 9.0 / 8.4 / 8.3 / 8.2 / 8.1 / 8.0 / 7.4 / 7.3
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead.

30.3. Closing a Connection

To close a connection, use the following statement:


The connection can be specified in the following ways:

  • connection-name



  • ALL

If no connection name is specified, the current connection is closed.

It is good style that an application always explicitly disconnect from every connection it opened.