DBLINK_DISCONNECT(3)

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

Okay so hi bestie πŸ’– this is the DBLINK_DISCONNECT(3) manual page from the PostgreSQL 15.19 Documentation, and it's literally about closing a persistent connection to a remote database. No cap, it's giving β€œwe need to talk” but for your database link. πŸ’€βœ¨


🌸 NAME 🌸

dblink_disconnect β€” closes a persistent connection to a remote database.

✨ SYNOPSIS ✨

Two flavors, bestie, and both return text:

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. So if you opened it and didn't give it a name, this no-arg version is your girl. Periodt. πŸ’…

πŸŽ€ ARGUMENTS πŸŽ€

  • connname β€” the name of a named connection to be closed. Like, if you gave your connection a name, hand it over here so it knows exactly which one to break up with. 🫢

πŸ”₯ RETURN VALUE πŸ”₯

Returns status, which is always OK (since any error causes the function to throw an error instead of returning). So yes bestie, if you get a return value back, it's OK β€” the drama happens as an error, not as a return. ✨

🌈 EXAMPLES 🌈

Let's see the breakup in action, no cap:

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

And with a named connection:

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

That's the whole page, bestie! This little edit is from PostgreSQL 15.19, dated 2026, and it's the DBLINK_DISCONNECT(3) manual page. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from