Skip to content

Tableau Postgres set up

Seongjin Yoon edited this page Oct 18, 2023 · 1 revision

Installing Tableau

To get started with Tableau, you'll need to install Tableau Desktop. Follow these steps to install it:

  1. Visit the [Tableau Desktop download page](https://www.tableau.com/products/desktop)
  2. Download the Tableau Desktop installer suitable for your operating system.
  3. Run the installer and follow the on-screen instructions. You can generally use the default settings for a standard installation.
  4. After completing the installation, you should now have Tableau Desktop installed on your computer.

Installing PostgreSQL

If you want to integrate Tableau with PostgreSQL, you'll need to install PostgreSQL. Here's how to do it on macOS:

  1. Download the Interactive installer for PostgreSQL for macOS from [the official PostgreSQL download page](https://www.postgresql.org/download/macosx/).

  2. Run the installer through the GUI and use the default settings. The installation path is typically /Library/PostgreSQL/14, and set the password to "postgres."

  3. Add PostgreSQL's bin directory to your system's PATH. You can do this by editing your shell profile. For example, if you're using bash, you can run:

    vi .bash_profile
    # or
    vi .zprofile

    Then, add the following line to export the PATH:

    export PATH="/Library/PostgreSQL/14/bin:$PATH"
  4. Start the PostgreSQL server:

    sudo -u postgres pg_ctl -D /Library/PostgreSQL/14/data start

    to stop it, use:

    sudo -u postgres pg_ctl -D /Library/PostgreSQL/14/data stop

Configuring authentificaiton method

To configure PostgreSQL authentication, open the following file and modify it as shown:

Open the file /var/lib/pgsql/14/data/pg_hba.conf andmodify the file to include the following lines:

# "local" is for Unix domain socket connections only
# local user no authentication
local   all             all                                     trust
# IPv4 local connections:
host    all             all             0.0.0.0/0            		trust
# IPv6 local connections:
host    all             all             ::1/128                 trust

Import Data

  1. Create a new "tpch" database on your PostgreSQL server:

    psql -d postgres -U postgres
    postgres=# CREATE DATABASE tpch;
  2. Copy the data to the "tpch" database using the pg_dump command. Replace pg_dump_tpch_lineitem.sql with your actual data file.

    psql --host localhost --port=5432 --username=postgres --password --dbname=tpch -f pg_dump_tpch_lineitem.sql
  3. Your data should now be imported into the "tpch" database.

    Create a configuration file named smart-pgjdbc.config in your main directory. The location for this file on macOS is typically /Users/{username}/smart-pgjdbc.config. Add the following code to the file:

    smartjdbc.server.url=http://querybooster.ics.uci.edu:8000
    #app.guid=Alice-Tableau-Twitter-Pg
    app.guid=Bob-Tableau-Tpch-Pg

​ You can manually choose to log in as Alice or Bob in QueryBooster.

Installing the JDBC Driver

To use PostgreSQL with Tableau, you need the JDBC driver. Install the JDBC driver and make sure it's located in the appropriate directory. The driver should be in /Users/{username}/Library/Tableau/Drivers.

To run QueryBooster, follow the README.md to set up QueryBooster.