DBLINK_GET_CONNECTIONS(3pg17)

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

πŸ’… NAME πŸ’…

Okay so bestie, listen up β€” dblink_get_connections is the function that literally hands you back the names of all the open named dblink connections. Like, every single one that's currently vibing in your session. No cap. 🌈

This is page 3 of the PostgreSQL 17.11 docs, and yes we are reading the whole thing together, grab a snack πŸ“


✨ SYNOPSIS ✨

dblink_get_connections() returns text[]

That's the whole signature, she's simple and she slays πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

So the way this works: dblink_get_connections returns an array β€” a whole lil lineup β€” of the names of all the open named dblink connections. That's it, that's the whole job. She's the group chat member list, but for your dblink connections πŸ‘‘


🌸 RETURN VALUE 🌸

You get back a text array stuffed with connection names. Cute!

But lowkey important: if there are none β€” like, zero, nothing, an empty friend group 😭 β€” it returns NULL. Not an empty array, bestie. NULL. Write that down 🫢


πŸ”₯ EXAMPLES πŸ”₯

Just call her, that's it:

SELECT dblink_get_connections();

Iconic. Periodt. πŸ’œ


fr fr, the only gotcha here is the NULL-when-empty thing β€” don't get caught out thinking you'll get an empty array back, because you will not πŸ’€

That's the whole page, bestie β€” short and sweet, she ate and left no crumbs πŸ‘‘ This was DBLINK_GET_CONNECTIONS(3) from the PostgreSQL 17.11 documentation, dated 2026. Go forth and query your connections ✨🧚

πŸ“¦ where this page comes from