]> 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:01:40 +0000 (17:01 -0400)
commit44f55913267481165cd9dbfb6ebffa05a72424bd
tree837d019b0151401e5adccb13f594dbac2c1dc254
parentcbe38dbc667436f5da74ce7c3d6e5451f41c62e2
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
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