HOW-TO ยท WATCH THIS

Postgres can push a notification. Something still has to listen.

By Chris Davidson, founder of yForest · Updated September 26, 2026

LISTEN/NOTIFY is real push, but it needs a permanently connected listener that can silently miss events while it's down. Here's both, honestly.

Start 14-day free trial Download on theMac App Store

No credit card. 14 days. Cancel in one click.

macOS 15+ · Apple Silicon native · 14-day free trial · No credit card

Quick answer: Postgres LISTEN/NOTIFY pushes a payload the instant a trigger fires, but only to a listener connected at that moment, nothing is queued if it's offline. A Watch skips the listener: it re-runs your query on a schedule and alerts on Changed. Slower, with nothing that can silently miss an event.

What LISTEN/NOTIFY actually does

Postgres has a real pub/sub mechanism built in. A trigger calls pg_notify() when a row changes, and any client that's issued LISTEN on that channel gets the payload the moment it's sent, no polling delay. A trigger and function that fire on every order change:

CREATE OR REPLACE FUNCTION notify_order_change() RETURNS trigger AS $$
BEGIN
  PERFORM pg_notify('order_changes', row_to_json(NEW)::text);
  RETURN NEW;
END;
$$ LANGUAGE plpgsql;

CREATE TRIGGER order_change_trigger
AFTER INSERT OR UPDATE ON orders
FOR EACH ROW EXECUTE FUNCTION notify_order_change();

A client then does the other half:

LISTEN order_changes;
-- a persistent connection blocks here, waiting for the next NOTIFY payload

The part that's easy to skip past

That last line is the catch. Something has to hold that connection open, permanently, listening. If the listener process crashes, redeploys, or your laptop goes to sleep, every NOTIFY sent while it's down is gone. Postgres doesn't queue notifications for a disconnected listener, there's no replay when it reconnects. The payload is also capped at 8000 bytes, so it works for a row ID or a small JSON diff, not a full row dump on a wide table. LISTEN/NOTIFY is genuinely fast, but it's push infrastructure you have to run and supervise, not a free feature.

If you just want to know when something changed

If the actual goal is "tell me when this changed," not "push it to my running application in under a second," a Watch skips the listener entirely. QueryFlow re-runs your saved query on a schedule and compares the result; nothing has to stay connected between checks.

Before you start

A query that returns the row or value you care about, and QueryFlow Pipelines.

Steps

  1. Run the query you want to keep an eye on, then click Watch this.
  2. Name it, and confirm the Connection and SQL.
  3. Choose what to watch: Any change for a row like the example below, or A value for one column.
  4. Pick a Condition: Changed is the direct equivalent of "tell me when this is different."
  5. Set Check every, choose Destinations, and Save.

A worked example

SELECT id, status, updated_at
FROM public.orders
WHERE id = 48213;

Watch Any change on this, Check every 15m, destination Slack. Every 15 minutes QueryFlow re-runs the query and compares the row to the last check; the moment status or updated_at differs, a message goes to Slack. No trigger to write, no listener process to keep alive.

Check it worked

Use Run preview before saving to confirm the current row. After saving, change the row's status manually and use Check now from the Watches list to confirm the alert actually fires and reaches Slack.

Troubleshooting

If you seeFix
A NOTIFY was sent but nothing received itThe listener wasn't connected at that moment. Postgres doesn't queue it, there's nothing to replay.
Watch shows as failing, not alertingThat's a connection problem, not a data problem. Check the connection's Test result.
No alert despite a real changeConfirm the Condition is Changed (not a value-specific Condition) and that Check every has elapsed since the last check.

A large payload doesn't fit through NOTIFY anyway

The trigger example above sends the whole changed row as JSON, which works until the row gets wide. A NOTIFY payload is capped at 8000 bytes, so a table with a large text column or many fields needs the trigger to send a smaller payload, an ID and a couple of fields, and have the listener query the full row itself. A Watch has no equivalent limit to think about, since it's just reading the query's normal result, not packing it into a notification channel.

Using both together

These aren't strictly either-or. A team running LISTEN/NOTIFY inside an application can still add a Watch on the same table as a safety net: if the listener process ever goes down for an extended period, deploys, crashes, gets rescheduled, the Watch still catches the change on its own schedule and sends an alert, even though the application itself missed the instant push. The Watch is slower but it has nothing that can silently stop working the way an unmonitored listener process can.

Which one to actually use

Use LISTEN/NOTIFY when you're already running a persistent application process and need a change pushed into it in under a second, that's what it's built for. Use a Watch when you want to know about a change and you're fine hearing about it within a few minutes, without standing up or supervising a listener at all. Most "did this change" questions that end up in Slack or email are the second case.

QueryFlow Studio $9.99/mo · $99/yr
QueryFlow Pipelines $29.99/mo · $199.99/yr

Frequently asked

Can Watch This use Postgres LISTEN/NOTIFY under the hood?

No. Watch This polls: it re-runs your saved query on the Check every interval and evaluates the Condition each time. It doesn't hold open a LISTEN connection, so it has no sub-second push, but it also has nothing that can silently miss a notification the way an offline listener does.

Is Watch This real-time?

No, it's bound to Check every, as often as every 5 minutes. If you need push notifications inside your own application in under a second, LISTEN/NOTIFY with a supervised listener is the right tool, not Watch This.

What's the actual failure mode of LISTEN/NOTIFY?

Postgres doesn't queue notifications for a listener that isn't connected. If your listener process crashes, deploys, or restarts, any NOTIFY sent during that window is gone, there's no replay.

Which QueryFlow tier includes Watch This?

Pipelines. Studio covers querying and the Explorer; Watch This, Data Sync and the wider set of schedule destinations are Pipelines features.

Know when it changed, without running a listener.

14-day free trial, no card. Set your first Watch in a few minutes.

Start 14-day free trial

No credit card. 14 days. Cancel in one click.