
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)

## Description

`dblink_get_notify` retrieves notifications on either the unnamed connection, or on a named connection if specified. To receive notifications via dblink, `LISTEN` must first be issued, using `dblink_exec`. For details see [LISTEN](https://www.postgresql.org/docs/current/sql-listen.html "LISTEN") and [NOTIFY](https://www.postgresql.org/docs/current/sql-notify.html "NOTIFY").

## Arguments

_`connname`_

The name of a named connection to get notifications on.

## Return Value

Returns `setof (notify_name text, be_pid int, extra text)`, or an empty set if none.

## Examples

SELECT dblink\_exec('LISTEN virtual');
 dblink\_exec
-------------
 LISTEN
(1 row)

SELECT \* FROM dblink\_get\_notify();
 notify\_name | be\_pid | extra
-------------+--------+-------
(0 rows)

NOTIFY virtual;
NOTIFY

SELECT \* FROM dblink\_get\_notify();
 notify\_name | be\_pid | extra
-------------+--------+-------
 virtual     |   1229 |
(1 row)
