PostgreSQL

Configure PostgreSQL with Zing

PostgreSQL is one of the most widely used databases in the world, and its free! Everybody from developers writing their first line of code, to data scientists, to major corporations use PostgresSQL to store and query data.

You can connect Zing to your Postgres database from either the Zing web console, the Zing web app, the iOS app, or Android.

You’ll need:

  • Hostname which is the URL or IP address of your database
  • Port which is the port that your database is live on – typically 5432 by default for Postgres, but your port may differ
  • Database Name which is the name on your hostname IP / URL you database is referenced by
  • Username which is…your username. Best practice is to create a read only user
  • Password which is…your password. Once you enter this, Zing will automatically encrypt this.

Web Console

Add a PostgreSQL database from the web console:

  1. Go to your Zing Data Web Console and ensure you are logged in

  2. Tap the ‘data sources’ tab

  3. Enter your PostgreSQL credentials, as outlined above. If your database requires SSL to be enabled, turn on ‘Require SSL’ (not all Postgres configurations require this).

  4. Tap ‘Save’

  5. The data source you just added will be available to everybody in your organization.

SSH Tunneling

Zing Data supports connecting to your postgres database via an SSH tunnel (sometimes referred to as SSH port forwarding). In an SSH tunnel, the entire network connection between your postgres database and the Zing Data platform is encrypted. This provides adequate security, even for databases that do not have SSL. In some cases, and for some databases, an SSH tunnel can provide better performance than connecting over SSL.

When seting up an SSH tunnel, you will need the following

  • SSH username

    This is the username of the ssh tunnel.

  • SSH private key

    Enter the SSH private key in RSA pem format in the text area. Make sure to not modify any of the newlines.

  • SSH password

    This is usually not required, as an SSH tunnel can be set up without one.

  • SSH port

    This is not modifiable at present, Zing Data will attempt to initiate the tunnel connection over port 22.

App

To add a PostgreSQL database from your phone or the Zing Web App:

  1. Go to the sources tab

  2. Tap ‘Add a new data source’

  3. Enter your database credentials

  4. Tap ‘Confirm data source’

  5. Zing will verify that it can connect to your data source and if successful, add it as a source. If Zing cannot connect to your data source, you'll see a message asking your to check your credentials and retry. If even after checking your credentials and retrying you still experience issues, reach out to Zing support here