]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
parse ON UPDATE / ON DELETE in any order
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 3 Feb 2026 21:11:13 +0000 (16:11 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 4 Feb 2026 14:55:16 +0000 (09:55 -0500)
commit6fbdd3602136fe7589238c657f61de60b85c3c54
tree62685890e1f41c9ba26e8695e73571033f46cb14
parente4b968aebc6a9b5ddc5523039f02049dadb0fe28
parse ON UPDATE / ON DELETE in any order

Fixed an issue in the PostgreSQL dialect where foreign key constraint
reflection would incorrectly swap or fail to capture ``onupdate`` and
``ondelete`` values when these clauses appeared in a different order than
expected in the constraint definition. This issue primarily affected
PostgreSQL-compatible databases such as CockroachDB, which may return ``ON
DELETE`` before ``ON UPDATE`` in the constraint definition string. The
reflection logic now correctly parses both clauses regardless of their
ordering.

Fixes: #13105
Change-Id: I1331b433f713632e84ae6a34467806e080b8003e
doc/build/changelog/unreleased_20/13105.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/base.py
test/dialect/postgresql/test_dialect.py
test/dialect/postgresql/test_reflection.py