Tableau Error: Unable to connect to the data source

After a fresh Tableau Server install, if you haven't installed PostgreSQL database drivers, you will run into this error when trying to view a Tableau Dashboard that has a live connection to PostgreSQL.

Download the PostgreSQL database drivers from Tableau

This post assumes you have Tableau Server installed on a Ubuntu operating system.

Find the latest PostgreSQL database drivers on Tableau's Driver Download page.

Data Source PostgreSQL
Operating System Linux
Bit Version 64-bit

Copy the URL of the Download button.

On the Tableau Server's command line, download the file with wget and paste the copied URL.

For example:

cd ~
wget https://downloads.tableau.com/drivers/linux/deb/tableau-driver/tableau-postgresql-odbc_09.06.0501_amd64.deb

Results:

ubuntu@tableau-server:~$ wget https://downloads.tableau.com/drivers/linux/deb/tableau-driver/tableau-postgresql-odbc_09.06.0501_amd64.deb
--2020-06-28 21:52:11--  https://downloads.tableau.com/drivers/linux/deb/tableau-driver/tableau-postgresql-odbc_09.06.0501_amd64.deb
Resolving downloads.tableau.com (downloads.tableau.com)... 23.192.28.189
Connecting to downloads.tableau.com (downloads.tableau.com)|23.192.28.189|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 613620 (599K) [text/plain]
Saving to: ‘tableau-postgresql-odbc_09.06.0501_amd64.deb’

tableau-postgresql-od 100%[========================>] 599.24K  --.-KB/s    in 0.004s  

2020-06-28 21:52:11 (133 MB/s) - ‘tableau-postgresql-odbc_09.06.0501_amd64.deb’ saved [613620/613620]

Install the PostgreSQL database drivers

On the Tableau Server's command line, install the Tableau PostgreSQL ODBC driver with gdebi:

For example:

sudo gdebi tableau-postgresql-odbc_09.06.0501_amd64.deb

Results:

ubuntu@tableau-server:~$ sudo gdebi tableau-postgresql-odbc_09.06.0501_amd64.deb 
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Reading state information... Done

PostgreSQL ODBC Driver\nThis package includes the driver needed for applications to access a PostgreSQL system via ODBC (Open Database Connectivity).
Do you want to install the software package? [y/N]:y
Selecting previously unselected package tableau-postgresql-odbc.
(Reading database ... 144767 files and directories currently installed.)
Preparing to unpack tableau-postgresql-odbc_09.06.0501_amd64.deb ...
Unpacking tableau-postgresql-odbc (09.06.0501) ...
Setting up tableau-postgresql-odbc (09.06.0501) ...

Test connectivity on Tableau Server

Navigate back to your dashboard on Tableau Server and make sure the it renders properly without error.