]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
allow executemany values for ON CONFLICT DO NOTHING
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 31 Mar 2022 20:53:43 +0000 (16:53 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 31 Mar 2022 21:02:51 +0000 (17:02 -0400)
commit00b37e1462ad6aa4b85d3eec7d07a90a7b6c480c
tree8ec5fb24af1197a90cc5db59598653106714fa0c
parente6d783b293095030c864292ed3c67402497c4174
allow executemany values for ON CONFLICT DO NOTHING

Scaled back a fix made for :ticket:`6581` where "executemany values" mode
for psycopg2 were disabled for all "ON CONFLICT" styles of INSERT, to
not apply to the "ON CONFLICT DO NOTHING" clause, which does not include
any parameters and is safe for "executemany values" mode.  "ON CONFLICT
DO UPDATE" is still blocked from "executemany values" as there may
be additional parameters in the DO UPDATE clause that cannot be batched
(which is the original issue fixed by :ticket:`6581`).

Fixes: #7880
Change-Id: Id3e23a0c6699333409a50148fa8923cb8e564bdc
(cherry picked from commit cc8c5835a92b0035530b541c81b0c714b570b095)
doc/build/changelog/unreleased_14/7880.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/dialects/postgresql/psycopg2.py
lib/sqlalchemy/sql/compiler.py
test/dialect/postgresql/test_dialect.py