DBLINK_GET_NOTIFY(3)

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

okay so bestie, welcome to DBLINK_GET_NOTIFY(3) from the PostgreSQL 18.6 docs β€” this is the page where you learn how to grab your async notifications off a dblink connection, and honestly? it's giving "small function, huge main character energy". πŸ¦‹


🌸 NAME 🌸

dblink_get_notify β€” retrieve async notifications on a connection πŸ’Œ


πŸŽ€ SYNOPSIS πŸŽ€

dblink_get_notify() returns setof (notify_name text, be_pid int, extra text)
dblink_get_notify(text connname) returns setof (notify_name text, be_pid int, extra text)

two flavours, same snack. no args, or hand it a connname. that's it, that's the whole vibe check. πŸ’…


πŸ”₯ DESCRIPTION πŸ”₯

so dblink_get_notify retrieves notifications on either the unnamed connection, or on a named connection if you specified one. pick your fighter. πŸ‘‘

lowkey important: to receive notifications via dblink, LISTEN must first be issued, using dblink_exec. no cap. you can't skip the LISTEN step and then act surprised when nothing shows up. πŸ™ˆ

for details see LISTEN(7) and NOTIFY(7). those are the receipts, go read them.


πŸ’– ARGUMENTS πŸ’–

  • connname β€” the name of a named connection to get notifications on. that's the whole argument, she's lowkey simple like that. 🌈

🌟 RETURN VALUE 🌟

returns setof (notify_name text, be_pid int, extra text), or an empty set if none. yes, empty set. zero rows. nothing. it happens, don't take it personally. πŸ’€


🫢 EXAMPLES 🫢

okay bestie, let's actually do the thing. first we LISTEN:

SELECT dblink_exec('LISTEN virtual');
 dblink_exec
-------------
 LISTEN
(1 row)

then we check for notifications, and bestie… nothing yet. zero rows. iconic in its emptiness:

SELECT * FROM dblink_get_notify();
 notify_name | be_pid | extra
-------------+--------+-------
(0 rows)

so now we fire one off with NOTIFY:

NOTIFY virtual;
NOTIFY

and NOW look at her. virtual came through with a be_pid of 1229, and extra is just chilling there empty:

SELECT * FROM dblink_get_notify();
 notify_name | be_pid | extra
-------------+--------+-------
 virtual     |   1229 |
(1 row)

ate. periodt. ✨


reminder: LISTEN first, then NOTIFY, then dblink_get_notify. in that order. iykyk. πŸ’œ

that's the whole page, babe β€” straight outta PostgreSQL 18.6, dated 2026, and filed under DBLINK_GET_NOTIFY(3). go get your notifications, you've got this. πŸŽ€βœ¨

πŸ“¦ where this page comes from