Advanced Postgres Connection
  • 09 Nov 2021
  • 1 Minute to read
  • Dark
    Light

Advanced Postgres Connection

  • Dark
    Light

Article Summary

Overview

Creating and using a custom connection string to integrate with Postgres allows specific parameters to be set to ensure a successful connection.  The following article will show how the connection string should be configured to allow SSL. 

The platform currently uses Npgsql v5.0.7 to connect with Postgres.

Setup

  1. In the Folder Tree, navigate to System > Integrations > Databases.
  2. Select Create Connection in the Top Bar.
  3. In the Database Integration window, give the connection a Name, select POSTGRES as the Database Type
  4. Set Custom Connection String to True
  5. Edit the below example string parameters to match the Npgsql properties and place the string into the Connection String text box.
    Host=hostname;Database=databasename;Port=5432;Integrated Security=False;Username=postgres;Password=xxx;TrustServerCertificate=True
    By default, Npgsql will validate the server's certificate; this will fail if the certificate is self-signed. Instruct Npgsql to ignore this by specifying Trust Server Certificate=true in the connection string. To precisely control how the server's certificate is validated, register UserCertificateValidationCallback on NpgsqlConnection.
    Resources

Was this article helpful?