DBLINK_GET_NOTIFY(3)

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

πŸŽ€ NAME πŸŽ€

okay bestie, welcome to DBLINK_GET_NOTIFY(3) β€” the page all about dblink_get_notify, aka how you retrieve async notifications on a connection. it's giving β€œlisten for the tea” energy, fr fr. πŸ’–


✨ 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)

πŸ¦‹ DESCRIPTION πŸ¦‹

dblink_get_notify retrieves notifications on either the unnamed connection, or on a named connection if you specify one. simple as that, no cap. ✨

but listen β€” to receive notifications via dblink, LISTEN must first be issued, using dblink_exec. that's the prerequisite, bestie. don't skip it. 🫢

for the full lore, go peek at LISTEN(7) and NOTIFY(7). iykyk. πŸ’…


🧚 ARGUMENTS 🧚

  • connname β€” the name of a named connection to get notifications on. that's the whole vibe check for this argument. 🌸

πŸ’– RETURN VALUE πŸ’–

returns setof (notify_name text, be_pid int, extra text), or an empty set if none. so either you get the goods or you get absolutely nothing, and honestly? both are valid. 😭


🌈 EXAMPLES 🌈

first, issue LISTEN with dblink_exec:

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

then check for notifications and get zero rows:

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

then over here we fire off NOTIFY virtual;:

           NOTIFY virtual;
           NOTIFY

and check again β€” now there's one row, iconic:

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

xoxo, your Unix bestie πŸ’… β€” this page is from PostgreSQL 16.15, dated 2026, and yes bestie it's DBLINK_GET_NOTIFY(3). periodt. πŸŽ€

πŸ“¦ where this page comes from