postgresqlunicodeodbcheroku-postgrestableau-desktop

Connect to Heroku PostgreSQL using Tableau ODBC and SSL


I'm trying to connect to my Heroku PostgreSQL database through Tableau and ODBC, this needs to be over ODBC because it needs to be SSL connection. This being said, I have configured a User DSN. I followed some of the steps from this blog.

  1. First, I ran this to install a driver:
brew install psqlodbc
  1. I edited my /usr/local/etc/odbcinst.ini file:
[PostgreSQL Unicode]
Description = PostgreSQL ODBC driver (Unicode version)
Driver      = /usr/local/lib/psqlodbcw.so
  1. I edited my odbc.ini.
nano ~/.odbc.ini 
[ib3db]
Driver      = PostgreSQL Unicode
Description = None
SSLMODE     = verify-ca
ServerName  = <host>
Database    = <db_name>
Port        = 5432
Username    = <username>
Password    = <pwd>
Pqopt       = sslcert=<.crt> sslkey=<.key> sslrootcert=<.crt>

I tested this in the terminal and it's working fine, I'm able to connect to my DB successfully. So, the configuration seems to be correct.

The issue arises when I try to connect via Tableau. After selecting To a Server > ODBC > DSN, I choose the previously created DSN named ib3db, and then I get this error:

[iODBC][Driver Manager]dlopen(PostgreSQL Unicode, 0x0006): tried: 'PostgreSQL Unicode' (relative path not allowed in hardened program), '/System/Volumes/Preboot/Cryptexes/OSPostgreSQL Unicode' (no such file), '/Applications/Tableau Desktop 2024.3.app/Contents/MacOS/PostgreSQL Unicode' (no such file), '/Applications/Tableau Desktop 2024.3.app/Contents/MacOS/PostgreSQL Unicode' (no such file), '/Applications/Tableau Desktop 2024.3.app/Contents/MacOS/PostgreSQL Unicode' (no such file), '/Applications/Tableau [iODBC][Driver Manager]Specified driver could not be loaded Generic ODBC requires additional configuration. The driver and DSN (data source name) must be installed and configured to match the connection.

Do I need to rename the previously installed driver to match the path Tableau is looking for?

How can I tell Tableau to go to the correct path to find the Driver I've installed?


Solution

  • I ended up using JDBC driver instead. For anyone wondering, you can also use JDBC to connect via SSL.

    First you need to install the driver.

    Then you need to build the URL connection, like:

    jdbc:postgresql://<hostname>:5432/<database_name>?ssl=true&sslmode=verify-ca&sslcert=<path_to_cert>&sslkey=<path_to_pk8>&sslrootcert=<path_to_crt>
    

    After that, you are all set up, you will only need to enter Username and Password and the connection should go through with no problems.

    Don't forget to change the permissions of the key:

    chmod 0600 ...