DBLINK_GET_NOTIFY(3)
β¨ DBLINK_GET_NOTIFY β¨
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,LISTENmust first be issued, usingdblink_exec. no cap. you can't skip theLISTENstep 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:LISTENfirst, thenNOTIFY, thendblink_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
- opensuse-leap 16.0: postgresql18-docs 18.6-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms