Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 1.21 KB

README.md

File metadata and controls

29 lines (20 loc) · 1.21 KB

Postgres' ODBC library

Install the libraries

$ brew tap dpogorelov/homebrew-psqlodbc
$ brew install libiodbc
$ brew install psqlodbc --with-iodbc

Configure ODBC

Although I've been able to connect to Redshift with unixodbc using the psqlodbc driver from R, I wasn't able to from Julia. I've been able to connect successfully with iODBC.

iODBC doesn't seem to like using configured DSNs. I've had success connecting from R, Julia, and Python using ODBC.

In all situations I've had to connect using ODBC's SQLDriverConnect routine.

Pkg.add("ODBC")
using ODBC

ODBC.advancedconnect("Driver=/usr/local/lib/psqlodbcw.so;Database=data;Username=user;Password=pass;Server=foo.redshift.amazonaws.com;Port=5439;")
ODBC.query("SELECT * FROM information_schema.tables")
install.packages("RODBC")
c <- odbcDriverConnect("Driver=/usr/local/lib/psqlodbcw.so;Database=data;Username=user;Password=pass;Server=foo.redshift.amazonaws.com;Port=5439;")
results <- sqlQuery(c, "SELECT * FROM information_schema.tables")