DBLINK_DISCONNECT(3)

πŸ“¦ version 17.11, in opensuse-leap 16.0

okay so this is the PostgreSQL 17.11 Documentation page for dblink_disconnect, and bestie it is iconic because it is literally how you hang up on a remote database connection. no cap. We keep the manual name right here near the top, periodt. ✨

πŸŽ€ NAME πŸŽ€

dblink_disconnect β€” closes a persistent connection to a remote database. She is the cleanup queen. πŸ§ΉπŸ‘‘

🌸 SYNOPSIS 🌸

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. The form with connname closes that named one. lowkey simple, highkey important.

πŸŽ€ ARGUMENTS πŸŽ€

  • connname β€” the name of a named connection to be closed. that's the whole vibe check bestie πŸ’–

πŸ’– RETURN VALUE πŸ’–

Returns status, which is always OK (since any error causes the function to throw an error instead of returning). so if you get OK, slay; if not, it threw. 🫢

πŸ”₯ EXAMPLES πŸ”₯

closing the unnamed connection, main character energy:

SELECT dblink_disconnect();
 dblink_disconnect
-------------------
 OK
(1 row)

closing the named connection 'myconn', iykyk:

SELECT dblink_disconnect('myconn');
 dblink_disconnect
-------------------
 OK
(1 row)

shoutout to PostgreSQL 17.11 and the 2026 date on this page β€” docs ate and left no crumbs. πŸ«ΆπŸ’…

πŸ“¦ where this page comes from