Advanced Postgres Connection
- 09 Nov 2021
- 1 Minute to read
- Print
- DarkLight
This documentation version is deprecated, please click here for the latest version.
Advanced Postgres Connection
- Updated on 09 Nov 2021
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
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
- In the Folder Tree, navigate to System > Integrations > Databases.
- Select Create Connection in the Top Bar.
- In the Database Integration window, give the connection a Name, select POSTGRES as the Database Type.
- Set Custom Connection String to True.
- 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?