postgreSQL.connection.close

Syntax

postgreSQL.connection.close (connectionRef)

Params

connectionRef is a reference to a connection as returned by postgreSQL.connection.open.

Action

Close the specified connection.

Returns

True.

Examples

postgreSQL.connection.close (connectionRef)

« true

Notes

To conserve system resources both on the client and the server, it is critically important that you call this verb when you no longer need a connection obtained by calling postgreSQL.connection.open. All code executed after opening a connection should run inside a try statement with the corresponding else block taking care of closing the connection even in case a script error is encountered.

When you call this verb, any changes you made to the database that have not yet been committed will be rolled back automatically, unless you previously switched the connection to auto-commit mode.

All cursors belonging to the specified connection that have not already been disposed when you call this verb will be disposed automatically. This means that after you called this verb, all references to cursors belonging to the closed connection have become invalid.

See Also

postgreSQL.connection.open

postgreSQL.connection.commit

postgreSQL.connection.setAutoCommit