pqlisten

command
v1.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Command pqlisten is a self-contained Go program which uses the LISTEN / NOTIFY mechanism to avoid polling the database while waiting for more work to arrive.

You can see the program in action by defining a function similar to the following:

CREATE OR REPLACE FUNCTION public.get_work()
  RETURNS bigint
  LANGUAGE sql
  AS $$
    SELECT CASE WHEN random() >= 0.2 THEN int8 '1' END
  $$
;

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL