-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows use psqlodbc-12.2 insert string error #1306
Comments
Do you still get the error on Windows if you use |
No, if not use fast_executemany, it work ok. |
fast_executemany is off by default because a lot of drivers behave unpredictably with it on. It seems support for array inserts is not widely implemented in ODBC drivers so that may be what you're experiencing. https://github.com/mkleehammer/pyodbc/wiki/Features-beyond-the-DB-API#fast_executemany |
Please first make sure you have looked at:
Environment
To diagnose, we usually need to know the following, including version numbers. On Windows, be
sure to specify 32-bit Python or 64-bit:
Issue
windows uses the odbc driver for pg, and use fast_executemany, inserting a string will cause an error, like this:
`
insert_list = [[1, '1'], [2, '2']]
cur.fast_executemany = True
cur.executemany('insert into test values(?, ?) ', insert_list)
create table test (id int, val char(10))
`
The program crashes on windows but works fine on linux.
The text was updated successfully, but these errors were encountered: