dblink_disconnect(3)

dblink_disconnect3

Closes a persistent connection to a remote database

Usage

dblink_disconnect() returns text
dblink_disconnect(text connname) returns text

Overview

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)

From postgresql 18.6-4 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.