]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
expand out Index if passed to "constraint"
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 22 Dec 2022 23:14:31 +0000 (18:14 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 22 Dec 2022 23:15:40 +0000 (18:15 -0500)
commit667e2e6d62dcdff8e08eec6dd76c25815dfc03cd
tree3b213b9f9c8d2797a4a9a71a345c646cbf1c7789
parent992fad6304d2455e01951ded331e3076828b997f
expand out Index if passed to "constraint"

Fixed bug where the PostgreSQL
:paramref:`_postgresql.OnConflictClause.constraint` parameter would accept
an :class:`.Index` object, however would not expand this index out into its
individual index expressions, instead rendering its name in an ON CONFLICT
ON CONSTRAINT clause, which is not accepted by PostgreSQL; the "constraint
name" form only accepts unique or exclude constraint names. The parameter
continues to accept the index but now expands it out into its component
expressions for the render.

Fixes: #9023
Change-Id: I6baf243e26bfe578bf3f193c162dd7a623b6ede9
(cherry picked from commit 5cc18bb80077e98418b4a8066c0bc628209f3ada)
doc/build/changelog/unreleased_14/9023.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/dml.py
test/dialect/postgresql/test_on_conflict.py