How-To Guides
Integration Guides
PostgreSQL Integration Guide
10min
review the following guide for setting up an integration between manufacturing connect edge and a postgresql database user scenario in this guide you will deploy a postgresql database container from manufacturing connect edge and then integrate with the database using the db postgresql server connector for your specific scenario you may use an external postgresql server database to set up the integration for external postgresql databases, refer to the following links to learn more postgresql docker image postgresql documentation step 1 add device follow the steps to connect a device docid\ rfvijdxz7dbad8mwbisma the device will be used to store tags that will be eventually used to create outbound topics in the connector make sure to select the enable data store checkbox step 2 add tags after connecting the device in manufacturing connect edge, you can add tags docid\ ioanzd2awqnkuppgee3eh to the device create tags that you want to use to create outbound topics for the connector step 3 add postgresql marketplace application note the version used in this use case for postgresql is 9 6 5 to add the postgresql marketplace application in manufacturing connect edge, navigate to applications > marketplace click marketplace list and select default marketplace catalog click the postgresql application tile from the installation script version drop down list, select 9 6 5 enter a name and description for the application update the database name, username, and password as needed copy the database name, username, and password and store for reference later click launch navigate to applications > catalog apps the postgre application appears, pulls the image, and then starts the application the application shows as running navigate to applications > containers the postgre application container is running copy the ip address for the postgresql application step 4 add the db postgresql connector follow the steps to add a connector docid\ m2nifnaadyphcvzwmcoto and select the db postgresql provider configure the following parameters name enter a name for the connector hostname paste the ip address you copied in step 3 port the postgresql server port the default value is 5432 username paste the username configured in step 3 password paste the password configured in step 3 database paste the database name configured configured in step 3 table enter devicehub if you are sending data to an existing table, use the corresponding 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) docid\ fi9mbiprrrixufdihwql9 to learn more to add key/value pairs for the custom table, see work with tables in sql connectors (create table and show mapping) docid\ fi9mbiprrrixufdihwql9 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) docid\ fi9mbiprrrixufdihwql9 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 5 enable the connector after adding the connector, click the toggle in the connector tile to enable it if you see a failed status, you can review the manage connectors docid\ zz28hztqbk7od xsj81o8 and relevant error messages step 6 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 to create outbound topics click the connector tile the connector dashboard appears click the topics tab click the import from devicehub tags icon the devicehub import dialog box appears select all the tags to import and click import 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 7 enable topics to enable the topics, return to the topics tab and click the enable all topics icon step 8 make postgresql queries you can now verify that you can view data through the terminal command window update the credentials, database name, and table name to your specific configurations to make queries in the container terminal in manufacturing connect edge, navigate to applications > containers click the terminal icon next to the postgresql container the postgresql shell opens from the postgresql container terminal, enter psql h localhost u postgres and press enter the psql (13 2 (debian 13 2 1 pgdg100+1)) version number appears enter \l and press enter the list of databases appears in the console enter \c postgres and press enter you are now connected to database "db example" as user "postgres" appears enter \dt and press enter the list of relations appears showing the devicehub schema enter \d devicehub and press enter the public devicehub table appears enter \du and press enter the list of roles appears enter select from devicehub; and press enter the data for the devicehub table appears