]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix PostgreSQL for_update on JTI subclasses 4551/head
authorraylu <lurayl@gmail.com>
Sat, 16 Mar 2019 00:24:39 +0000 (17:24 -0700)
committerraylu <lurayl@gmail.com>
Wed, 20 Mar 2019 18:16:52 +0000 (11:16 -0700)
commit452da77d154a4087d530456db1c9af207d65cef4
tree59bfa81ee68296ce7b10592aea0690578e169ce0
parent8eaccf16aca90ef09e8e39cd06940ac8a51b5b38
Fix PostgreSQL for_update on JTI subclasses

When using joined table inheritance, querying for a child model
automatically joins to the parent model. When passing the child model to
with_for_update's of kwarg like with_for_update(of=Engineer), this
results in invalid SQL like
FOR UPDATE OF engineer JOIN employee ON engineer.id = employee.id

Fixes #4550
lib/sqlalchemy/dialects/postgresql/base.py
test/dialect/postgresql/test_compiler.py