Closed Lotram closed 3 years ago
hi -
set up your engine using executemany_mode=None right now to work around this:
e = create_engine("postgresql://scott:tiger@localhost/test", echo=True, executemany_mode=None)
Thanks, it does work with this option
Mike Bayer has proposed a fix for this issue in the master branch:
don't enable "fast insert executemany" for ON CONFLICT etc https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/2857
this should be all good in the next release
Describe the bug
HI, I'm trying to migrate from 1.3.23 to 1.4.17, with a Postgres DB. I have an error while trying to use
on_conflict_do_update
with a constant in theset_
arg, I hope I did not miss anything in the doc about migrating to 1.4 which could explain this.To Reproduce
Error
Versions.
Additional context I did some investigation on this error:
do_executemany
method, the statement sent toexecute_values
is'INSERT INTO github_users (id, login, is_deleted) VALUES %s ON CONFLICT (id) DO UPDATE SET updated_at = now(), login = excluded.login, is_deleted = %(param_1)s'
The%(param_1)s
should not be here, that's why psycopg2 raises an error."is_deleted": False
from theset_
, everything works fine.do_executemany
method,self.executemany_mode is EXECUTEMANY_DEFAULT
is True, soself._psycopg2_extras().execute_values
is not called.Let me know if I need to provide more info about this. Have a nice day!