How-To Guides
Integration Guides

PostgreSQL SSL Integration Guide

9min

Review the following guide for setting up an integration between Manufacturing Connect Edge and a PostgreSQL database using SSL authentication.

Before You Begin

You will need the following:

  • Access to a PostgreSQL database that uses SSL authentication.
  • The CA Certificate and any other required authentication parameters to access the database.

Refer to the following links to learn more:

Step 1: Add Device



Step 2: Add Tags



Step 3: Add the DB - PostgreSQL SSL Connector

Follow the steps to Add a Connector and select the DB - PostgreSQL SSL provider.

Configure the following parameters.

  • Name: Enter a name for the connector.
  • Hostname: Enter the hostname for the PostgreSQL database.
  • Port: The PostgreSQL Server port. The default value is 5432.
  • SSL Mode: Select the SSL Mode (require, verify-ca, verify-full).
  • CA Certificate: Paste or upload the CA certificate associated with the database.
  • Certificate: Paste or upload the SSL certificate.
  • Private Key: Enter or paste the SSL private key.
  • Username: Enter the appropriate username.
  • Password: Enter the password for the username.
  • Database: Enter the database name.
  • Table: Enter the table name.
  • Show Mapping: If you want to send data to a custom table, select this checkbox and unselect Create table. See Work with Tables in SQL Connectors (Create Table and Show Mapping) to learn more. To add key/value pairs for the custom table, see Configure Key/Value Pairs.
  • Create table: If you want to send data to an existing table in the default format, or you want to create a new table in the default format, select this checkbox and unselect Show Mapping. See Work with Tables in SQL Connectors (Create Table and Show Mapping) to learn more.
  • Commit timeout: Enter the transaction commit timeout in (ms).
  • Max transaction size: Enter the maximum number of messages before a transaction is committed, regardless of timeout parameter.
  • Throttling limit: The maximum number of messages per second to be processed. The default value is zero, which means that there is no limit.
  • Persistent storage: When enabled, this will cause messages to undergo a store-and-forward procedure. Messages will be stored within Manufacturing Connect Edge when cloud providers are online.
  • Queue Mode: Select the queue mode as lifo (last in first out) or fifo (first in first out). Selecting lifo means that the last data entry is processed first, and selecting fifo means the first data entry is processed first.

Step 4: Enable the Connector

After adding the connector, click the toggle in the connector tile to enable it.

Document image


If you see a Failed status, you can review the Connector Logs and relevant error messages.

Step 5: Create Topics for Connector

You will now need to import the tags created in Step 2 as topics for the PostgreSQL connector. The topics will be created as outbound topics.



After adding all required topics, navigate to the Integration overview page and ensure the connector is not disabled and still shows a CONNECTED status.

Step 6: Enable Topics



Step 7: Make PostgreSQL Queries

You can now verify that you can view data in the PostgreSQL database.

Update the credentials, database name, and table name to your specific configurations.

To make PostgreSQL queries:

  1. From the PostgreSQL terminal window, enter psql -h locahost -U postgres and press ENTER. The psql (13.2 (Debian 13.2-1.pgdg100+1)) version number appears.
  2. Enter \l and press ENTER. The list of databases appears in the console.
  3. Enter \l db-example and press ENTER. The list of databases shows only db-example.
  4. Enter \c postgres and press ENTER. You are now connected to database "db-example" as user "postgres" appears.
  5. Enter \dt and press ENTER. The list of relations appears showing the devicehub schema.
  6. Enter \d devicehub and press ENTER. The public.devicehub table appears.
  7. Enter select * from devicehub; and press ENTER. The data for the devicehub table appears.