-
Notifications
You must be signed in to change notification settings - Fork 564
Connecting to Vertica
Siting Ren edited this page Dec 15, 2021
·
3 revisions
Vertica is essentially a fork of PostgreSQL, so a lot of what can be said about PostgreSQL applies to Vertica as well.
# Python 3.x
cnxn.setdecoding(pyodbc.SQL_WCHAR, encoding='utf-8')
cnxn.setencoding(encoding='utf-8')
# Python 2.7
cnxn.setdecoding(pyodbc.SQL_WCHAR, encoding='utf-8')
cnxn.setencoding(str, encoding='utf-8')
cnxn.setencoding(unicode, encoding='utf-8', ctype=pyodbc.SQL_CHAR)
Bear in mind, after setting up your odbcinst.ini
and odbc.ini
files, you will still need to set up a vertica.ini
file (see here) which defines, among other things, the driver manager encoding.