---
name: "dblink_disconnect"
section: "3"
platform: "linux"
package: "postgresql"
version: "18.6-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/dblink_disconnect"
---

# dblink\_disconnect(3)

closes a persistent connection to a remote database

## NAME

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