Skip to content

Fix/quote identifiers - #175

Open
chandr-andr wants to merge 3 commits into
mainfrom
fix/quote-identifiers
Open

Fix/quote identifiers#175
chandr-andr wants to merge 3 commits into
mainfrom
fix/quote-identifiers

Conversation

@chandr-andr

Copy link
Copy Markdown
Member

No description provided.

Savepoint names and listener channel names were interpolated into SQL as
raw text and sent through batch_execute, which uses the simple query
protocol and therefore accepts several statements in one message. A name
coming from the outside was arbitrary SQL execution:

    await transaction.create_savepoint("sp1; DROP TABLE users")

Both now go through the existing quote_ident helper.

For LISTEN/UNLISTEN this also fixes mixed-case channels. Unquoted
LISTEN MixedCase is folded by the backend to mixedcase, so the delivered
notification carried a channel name that never matched the key the
callback was registered under and the callback silently never fired.
Lowercase channel names, which is what practically everyone uses, behave
exactly as before.
@chandr-andr
chandr-andr force-pushed the fix/quote-identifiers branch from cb99b20 to 3422b8f Compare August 16, 2026 21:01
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.

1 participant