]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
escape single quotes in postgresql nextval() identifier rendering
authorJavid Khan <dxbjavid@gmail.com>
Tue, 21 Jul 2026 05:53:51 +0000 (01:53 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 22 Jul 2026 20:28:55 +0000 (16:28 -0400)
commitdbf2f9583b6767a14a5db3dc40777b6bf0c2c0df
treed30c446fbe8071f70e26c0d64c778c7fccff82ba
parent10cdc38ccf037617ef9baa4e816b5ff377f58a38
escape single quotes in postgresql nextval() identifier rendering

Fixed bug in the PostgreSQL dialect where a single quote in a sequence,
table, or schema name, such as one supplied via a ``schema_translate_map``
or an explicit :class:`.Sequence`, could result in a malformed
``nextval()`` statement. The quote is now properly escaped. Pull request
courtesy dxbjavid.

Fixes: #13429
Closes: #13430
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/13430
Pull-request-sha: 0c19bcbd85c69b492542c43a693600595cbd0916

Change-Id: I6198d491a8ead7429fb5ac70e0502a6644f06810
doc/build/changelog/unreleased_20/13429.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/base.py
test/dialect/postgresql/test_compiler.py
test/dialect/postgresql/test_dialect.py