]> 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:30 +0000 (18:15 -0500)
commit5cc18bb80077e98418b4a8066c0bc628209f3ada
tree1c6cc5c68aa2cb027565f023767b3f52c5b06a49
parentb973cbd8939f2cc0e29c668fffd507958c3e455a
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
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