I’m trying to run a Shiny app with external PostgreSQL connection. When I do it with hardcoded data like below, it works, but when I want to move to use DSN and etc/odbc.ini file it doesn’t and I got an error (Error: nanodbc/nanodbc.cpp:1021: 00000: could not connect to server: No such file or directory). Both files odbc/odbcinst are configured properly. I think there is some missing connection path to that file from R session, but I’m not sure. Any hints what to check?
I’ve added (ADD odbc.ini /etc/odbc.ini) on my Docker file as well
Works
dbicon ← DBI::dbConnect(
odbc::odbc(),
driver = “PostgreSQL Driver”,
database = “mydb”,
server = “server”,
port = “port”,
uid = “uid”,
pwd = “pwd”)
Doesn’t work
dbicon ← DBI::dbConnect(odbc::odbc(), “PostgreSQL”)