Closing a Connection

PostgreSQL 9.0.13 Documentation
Prev | Up | Chapter 33. ECPG - Embedded SQL in C | Next

# 33.3. Closing a Connection

To close a connection, use the following statement:

    EXEC SQL DISCONNECT [connection];

The `connection` can be specified in the following ways:

- ``connection-name``

- `DEFAULT`

- `CURRENT`

- `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.

Prev | Home | Next
Connecting to the Database Server | Up | Running SQL Commands