Reading through the documentation of Tableau Server I was not able to determine if the following works:
I am also able to connect to the Tableau Server through Tableau Desktop BUT I cannot connect to the PostgreSQL as it is not directly accessible from the client machine running Tableau Desktop.
Is there a way to access this non-public PostgreSQL database connected to Tableau Server from Tableau Desktop through Tableau Server?
Answering my own question and following @matt_black's comment it is indeed possible to access and use published Datasources from Tableau Desktop which are not directly accessible.
For that you need to login to the Tableau-Server UI (not TSM via 8850), create a Workbook, click on "Datasource" (bottom left hand corner) add a single or multiple connections and then head back to any "Sheet" Tab (also bottom left hand corner).
At this point it is recommended to save the Workbook as "Template", i.e. "my_published_datasoure_template" – explanation follows.
After saving the Workbook you need to hover over the Datasource-Icon in the "Data" Tab and click on the appearing dropdown-arrow to publish the Datasource.
It needs to be mentioned, that once a Datasources has been published this way it asks you to update the workbook right afterwards which you must deny in order to be able to edit the Datasources of the workbook afterwards.
If you need to edit the Datasource at a later point be sure to delete the previously published Datasource then edit and re-publish it.
In Tableau Desktop select Data > Connect to Data, and then select PostgreSQL as the database to connect to.
Note: You might need to install the PostgreSQL database drivers. You can download drivers from www.tableau.com/support/drivers class="sr-only">(Link opens in a new window).
In the PostgreSQL connection dialog box, enter the name or URL for Tableau Server in the Server box. If you have a distributed server installation, enter the name or IP address of the node where the repository is hosted.
Connect using the port you have set up for the pgsql.port, which is 8060 by default.
Specify workgroup
as the database to connect to.
Connect using the user and the password you specified.
Click Connect.
Select one or more tables to connect to.
The tableau
user has access to all of the tables that start with an underscore or with hist_
. For example, you can connect to _background_tasks
and _datasources
. The hist_
tables include information about server users that isn't currently presented in the Actions by Specific User view. The readonly
user has access to additional tables that can be used to query other information about server usage.
Click Go to Worksheet.
Use the following steps to find the version of PostgreSQL used by Tableau Server:
If the server is accessible via SSH then you can set up a port forwarding tunnel.
ssh -L 127.0.0.1:5432:postgres.example.com:5432 tableau.example.com
Then in the datasource within Tableau Desktop change the host to 127.0.0.1 from postgres.example.com. If there are SSL errors you may want to add an entry to your /etc/hosts file and not change the hostname.
sudo echo '127.0.0.1 postgres.example.com' >> /etc/hosts