mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-09 18:30:39 -04:00
c3850e57c4
Fixed issue where :meth:`_postgresql.Insert.on_conflict_do_update` using parametrized bound parameters in the ``set_`` clause would fail when used with executemany batching. For dialects that use the ``use_insertmanyvalues_wo_returning`` optimization (psycopg2), insertmanyvalues is now disabled when there is an ON CONFLICT clause. For cases with RETURNING, row-at-a-time mode is used when the SET clause contains parametrized bindparams (bindparams that receive values from the parameters dict), ensuring each row's parameters are correctly applied. ON CONFLICT statements using expressions like ``excluded.<column>`` continue to batch normally. Fixed issue where :meth:`_sqlite.Insert.on_conflict_do_update` using parametrized bound parameters in the ``set_`` clause would fail when used with executemany batching. Row-at-a-time mode is now used for ON CONFLICT statements with RETURNING that contain parametrized bindparams, ensuring each row's parameters are correctly applied. ON CONFLICT statements using expressions like ``excluded.<column>`` continue to batch normally. Fixes: #13130 Change-Id: I0c5a9142401c745d38e58d071c16e53610f9bfea