Fix/quote identifiers - #175
Open
chandr-andr wants to merge 3 commits into
Open
Conversation
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
force-pushed
the
fix/quote-identifiers
branch
from
August 16, 2026 21:01
cb99b20 to
3422b8f
Compare
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.