Advanced Postgres Connection
- 18 Jul 2022
- 1 Minute to read
- Print
- DarkLight
Advanced Postgres Connection
- Updated on 18 Jul 2022
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
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. 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.
Additional Resources
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
For further information on Integrations, visit the Decisions Forum.
Was this article helpful?