Hevo can load data from any of your Pipelines into a PostgreSQL database. Follow the steps in this page to add PostgreSQL as a Destination.


Create a Database User and Grant Privileges

1. Create a database user

Perform the following steps to create the database user in your PostgreSQL database:

  1. Log in to your PostgreSQL server as a Superuser using an SQL client, such as psql.

  2. Enter the following command:

      CREATE USER <user_name> WITH PASSWORD '<strong password>';

    Note: Replace the placeholder values in the command given above with your own.

2. Grant privileges to the user

  1. Log in to your PostgreSQL server as a Superuser using an SQL client, such as psql.

  2. Run the following commands to grant the required privileges to the database user, to create the database objects needed to load and store your data:

      GRANT CREATE, TEMPORARY ON DATABASE <database_name> TO <user_name>;
      GRANT CREATE, USAGE ON SCHEMA <schema_name> to <user_name>;

    Note: Replace the placeholder values in the commands given above with your own.

Add Destination

Do one of the following:

  • After you configure the Source during Pipeline creation, click ADD DESTINATION.

  • Click DESTINATIONS in the Asset Palette, and then, in the Destinations List View, click + CREATE.

Select the Destination Type

In the Add Destination page, select PostgreSQL.

Alternatively, use the Search Destination Type search box to search for the Destination.

Configure PostgreSQL Connection Settings

Specify the following settings in the Configure your PostgreSQL Destination page:

PostgreSQL Destination settings

  • Destination Name: A unique name for your Destination.

  • Database Host: The PostgreSQL host’s IP address or DNS.

  • Database Port: The port number on which your PostgreSQL server listens for connections. Default value: 5432.

  • Database User: A user with a non-administrative role in the PostgreSQL database.

  • Database Password: The password of the database user.

  • Database Name: The name of the Destination database to which the data is loaded.

  • Database Schema: The name of the Destination database schema. Default value: public.

  • Additional Settings:

    • Connect through SSH: Enable this option to connect to Hevo using an SSH tunnel, instead of directly connecting your PostgreSQL database host to Hevo. This provides an additional level of security to your database by not exposing your PostgreSQL setup to the public. Read Connecting Through SSH.

      If this option is disabled, you must whitelist Hevo’s IP addresses. You can refer to the PostgreSQL Source documentation pages for the steps to whitelist the IP addresses of your region for your PostgreSQL variant.

    • Use SSL: Enable this option to use an SSL-encrypted connection. Specify the following:

      • CA File: The file containing the SSL server certificate authority (CA).

      • Client Certificate: The client public key certificate file.

      • Client Key: The client private key file.

      For the steps to create the required files and keys, read PostgreSQL

    • Sanitize Table/Column Names?: Enable this option to remove all non-alphanumeric characters and spaces in a table or column name, and replace them with an underscore (_). Read Name Sanitization.

Test Connection

After filling the details, click on TEST CONNECTION to test connectivity to the Destination Postgres server.

Save Connection

Once the test is successful, save the connection by clicking on SAVE & CONTINUE.

Destination Considerations

  • You must disable any foreign keys defined in the target tables. Foreign keys do not allow data to be loaded until the reference table has a corresponding key defined.

  • You can replicate data for only 1594 columns in a given PostgreSQL table. Read Limits on the Number of Columns.



Revision History

Refer to the following table for the list of key updates made to this page:

Date Release Description of Change
Sep-07-2022 NA - Updated the Prerequisites section and added the Create a Database User and Grant Privileges section.
Feb-21-2022 1.82 Updated section, Configure PostgreSQL Connection Settings to provide support for SSL in PostgreSQL as a Destination.
Jul-12-2021 NA Updated section, Destination Considerations.
Last updated on 26 Sep 2022

Tell us what went wrong