Skip to content

fix(pub_sub): escape channel and payload when rebuilding LISTEN/NOTIFY - #1763

Merged
levkk merged 1 commit into
pgdogdev:mainfrom
mhenrixon:fix/notify-payload-escaping
Oct 9, 2026
Merged

levkk merged 1 commit into
pgdogdev:mainfrom
mhenrixon:fix/notify-payload-escaping

Conversation

@levkk

@levkk levkk commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

The parser decodes NOTIFY chan, 'it''s here' into the payload it's here, and the pub/sub listener interpolated it back into SQL without escaping, sending NOTIFY "chan", 'it's here' to the server: a syntax error. Escape the payload with quote_literal and the channel with escape_identifier (a " in a quoted channel name broke LISTEN, UNLISTEN and NOTIFY the same way).

The parser decodes `NOTIFY chan, 'it''s here'` into the payload
`it's here`, and the pub/sub listener interpolated it back into SQL
without escaping, sending `NOTIFY "chan", 'it's here'` to the server: a
syntax error. Escape the payload with quote_literal and the channel with
escape_identifier (a `"` in a quoted channel name broke LISTEN, UNLISTEN
and NOTIFY the same way).
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@levkk
levkk added this pull request to the merge queue Oct 9, 2026
Merged via the queue into pgdogdev:main with commit 5b68a7c Oct 9, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants