February 26, 2026: PostgreSQL 18.3, 17.9, 16.13, 15.17, and 14.22 Released!
Supported Versions: Current (18) / 17 / 16 / 15 / 14
Development Versions: devel
Unsupported versions: 13 / 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3
dblink_disconnect
dblink_disconnect — closes a persistent connection to a remote database
Synopsis
dblink_disconnect() returns text dblink_disconnect(text connname) returns text
Description
dblink_disconnect() closes a connection previously opened by dblink_connect(). The form with no arguments closes an unnamed connection.
Arguments
connname
The name of a named connection to be closed.
Return Value
Returns status, which is always OK (since any error causes the function to throw an error instead of returning).
Examples
SELECT dblink_disconnect(); dblink_disconnect
OK (1 row)
SELECT dblink_disconnect('myconn'); dblink_disconnect
OK (1 row)
Submit correction
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.