Adds an optional third argument to pg_notify(). With ordered => false, a transaction whose notifications are all unordered skips the cluster-wide lock that NOTIFY holds through commit (WAL flush and sync-rep wait), so notifying transactions no longer have to commit one at a time. Delivery stays transactional and in send order within a transaction, and NOTIFY and the two-argument pg_notify() are unchanged. Includes a fix for a lost-wakeup case that appears once writers aren't serialized, plus doc

Log in to edit
ID 7793
Title Adds an optional third argument to pg_notify(). With ordered => false, a transaction whose notifications are all unordered skips the cluster-wide lock that NOTIFY holds through commit (WAL flush and sync-rep wait), so notifying transactions no longer have to commit one at a time. Delivery stays transactional and in send order within a transaction, and NOTIFY and the two-argument pg_notify() are unchanged. Includes a fix for a lost-wakeup case that appears once writers aren't serialized, plus doc
CI (CFBot) Summary
Stats (from CFBot) Patch version: v1, Patch count: 3, First patch: +27−44, All patches: +580−64
Tags Performance
Created 2026-12-04 08:06:03
Last modified 2026-12-04 08:06:04 (14 minutes ago)
Latest email 2026-11-25 15:44:03 (1 week ago)
Status
PG20-4 (2027-01-01 – 2027-01-31): Needs review
Target version 20
Authors Ivan Alekseev (nettrash)
Reviewers Log in to become reviewer
Committer
Links Git
Emails
[PATCH] Allow NOTIFY without cross-transaction commit ordering
First at 2026-11-25 15:44:03 by Ivan Alekseev <nettrash at nettrash.me>
Latest at 2026-11-25 15:44:03 by Ivan Alekseev <nettrash at nettrash.me>
Latest attachment (v1-0001-Hold-NotifyQueueLock-across-the-whole-of-a-NOTIFY.patch) at 2026-11-25 15:44:03 from Ivan Alekseev <nettrash at nettrash.me>
    Attachment (v1-0001-Hold-NotifyQueueLock-across-the-whole-of-a-NOTIFY.patch) at 2026-11-25 15:44:03 from Ivan Alekseev <nettrash at nettrash.me> (Patch: No)
History
When Who What
2026-12-04 08:06:04 Ivan Alekseev (nettrash) Attached mail thread 4B741003-AB93-4252-8F36-65D5AE06768F@nettrash.me
2026-12-04 08:06:04 Ivan Alekseev (nettrash) Created patch record
Log in to edit