It seems I cannot connect to Vertica via pyodbc on a mac. My exaxt same setup (modulo the paths) works fine on linux, though. I had no luck looking in these forums or anywhere else. Would anybody know what it going on ?
- Vertica client 6.1.2 or 6.1.3, installed as my user or root
- pyobc for all versions 3+
my relevant files are:
/etc/odbc.ini:
[VerticaDWHSTG]/etc/odbcinst.ini
Description = VerticaDSN ODBC driver for DWH (staging)
Driver = Vertica
Database = stgdwh
Servername = vertica.stg
UserName = stguser
Password = ****
Port = 5433
ConnSettings =
Locale = en_US@collation=binary
[Driver]
ErrorMessagesPath = /opt/vertica/lib/
ODBCInstLib = /usr/local/Cellar/unixodbc/2.3.1/lib/libodbcinst.dylib
DriverManagerEncoding=UTF-16
[Vertica]From then on, I run:
Description=Vertica driver
Driver=/opt/vertica/lib/libverticaodbc.dylib
Driver64=/opt/vertica/lib/libverticaodbc.dylib
Threading=1
VERTICAINI=/etc/odbc.ini python -c 'import pyodbc; pyodbc.connect("DSN= VerticaDWHSTG ")'
raceback (most recent call last): File "", line 1, in pyodbc.Error: ('HY000', '[] (10360) (SQLDriverConnect)')
- If I give a wrong DSN, which does not exist, I have another error message (Data source name not found...). which means that the right odbc.ini file is found.
- If I do not set VERTICAINI, Queries do run but the output is not right, for instance, where all values are numbers, dates or string:
python -c 'import pyodbc; c=pyodbc.connect("DSN=VerticaDWHSTG"); print c.cursor().execute("SELECT * from meta.spil_users").fetchone()'Is there a way around?
(u'g\x00u\x00i\x00l\x00l\x00a\x00u\x00m\x00e\x00.\x00r\x00o\x00g\x00e\x00r\x00', None, u's\x00p\x00i\x00l\x00', u'Z\x00e\x00B\x00o\x00s\x00s\x00', datetime.datetime(2013, 10, 15, 13, 57, 57, 100737), datetime.datetime(2013, 10, 15, 13, 57, 57, 100737), u'g\x00u\x00i\x00l\x00l\x00a\x00u\x00m\x00e\x00.\x00r\x00o\x00g\x00e\x00r\x00', u'd\x00e\x00f\x00a\x00u\x00l\x00t\x00', u'g\x00e\x00n\x00e\x00r\x00a\x00l\x00')
Thanks,
