Skip to main content Skip to footer

PostgreSQL Insert Documentation

Version: 2.0.0

Retrieved: 2025-10-09 15:16:11


PostgreSQL Server Insert

This module inserts a flow message into a PostgreSQL Server database row(s).

Settings

Name Requirements Purpose Default
Table Name Not null The name of the database table  
Source Property Not null The property that contains the values to be inserted  
Validate Written Rows boolean If checked, the module verifies that the number of rows written is not 0. This may cause false errors in some setups True

Credential

This module requires a credential of type 'Connection string' to connect to the database server. A minimal connection string is shown below. Depending on your database server setup, additional parameters may be needed. Please consult your server documentation.

Server=192.168.0.5;Database=crosser;User ID=demo;Password=crosser123;

Input

For a single row insert, the [Source Property] should contain an object with property names matching all required column names in the database table. For multi-row inserts, the [Source Property] should contain an array of single-row objects.

Name Type Description
[Source Property] string The name of the property that contains the object to be inserted into the database

Output

An output message will be sent each time the module receives a message.

Name Type Description
crosser.success Boolean True if the message was stored properly in the database, otherwise False
crosser.message String Contains an error message if the insert failed. If the insert is successful, this property is not set.

Examples

Example 1

Inserts a single row into the table test. The table expects at least two columns name and reading:

Settings

  • Source Property: info.data
  • Table Name: test

Input

{
  "id": 1,
  "name": "machine",
  "info": {
    "data": {
      "name": "sensor1",
      "reading": 489
    }
  }
}

Example 2

Inserts multiple rows into the table test. The table expects at least two columns name and reading:

Settings

  • Source Property: info.data
  • Table Name: test

Input

{
  "id": 1,
  "name": "machine",
  "info": {
    "data": [
      {
        "name": "sensor1",
        "reading": 489
      },
      {
        "name": "sensor2",
        "reading": 375
      },
      {
        "name": "sensor3",
        "reading": 961
      }
    ]
  }
}