diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-08-03 16:55:23 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-08-05 12:53:35 -0400 |
commit | 9f992e42189746a7aff497abcf6ea9c08ab79e97 (patch) | |
tree | e2929beb07c29813c16bac05060a89e112166ab9 /lib/sqlalchemy/dialects/postgresql/base.py | |
parent | 0027b3a4bc54599ac8102a4a3d81d8007738903e (diff) | |
download | sqlalchemy-9f992e42189746a7aff497abcf6ea9c08ab79e97.tar.gz |
translate joined inheritance cols in UPDATE/DELETE
Fixed issue in ORM enabled UPDATE when the statement is created against a
joined-inheritance subclass, updating only local table columns, where the
"fetch" synchronization strategy would not render the correct RETURNING
clause for databases that use RETURNING for fetch synchronization.
Also adjusts the strategy used for RETURNING in UPDATE FROM and
DELETE FROM statements.
Also fixes MariaDB which does not support RETURNING with
DELETE..USING. this was not caught in tests because
"fetch" strategy wasn't tested. so also adjust the ORMDMLState
classes to look for "extra froms" first before adding
RETURNING, add new parameters to interfaces for
"update_returning_multitable" and "delete_returning_multitable".
A new execution option is_delete_using=True, described in the
changelog message, is added to allow the ORM to know up front
if a certain statement should have a SELECT up front
for "fetch" strategy.
Fixes: #8344
Change-Id: I3dcdb68e6e97ab0807a573c2fdb3d53c16d063ba
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 8b89cdee2..8be221eee 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -2924,6 +2924,8 @@ class PGDialect(default.DefaultDialect): update_returning = True delete_returning = True insert_returning = True + update_returning_multifrom = True + delete_returning_multifrom = True connection_characteristics = ( default.DefaultDialect.connection_characteristics |