Skip to main content

Insert Table

Inserts data into a PostgreSQL table.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Connection Id - The unique identifier of the database connection to use.
  • Transaction Id - The unique identifier of the transaction (optional).
  • Table Name - The name of the table to insert data into.
  • Table Data - The data to insert, provided as a table structure.

Options

  • Ignore Conflicts - Ignores unique constraint violations without throwing an error.
  • Replace - Replaces existing rows when conflicts occur (conflicting column name must be specified).
  • Conflict Column Name - The name of the column to check for conflicts when using Replace.
  • Conflict Constraint Name - The name of the constraint to check for conflicts when using Replace.
  • Column Names with Special Characters - Adds quotes to column names.

Output

  • None

How It Works

The Insert Table node inserts data into a PostgreSQL table using the provided parameters. When executed, the node:

  1. Validates the provided connection ID and retrieves the connection
  2. Optionally retrieves the transaction if a transaction ID is provided
  3. Creates an insert command based on the table data and options
  4. Executes the insert command for each row in the table data

Requirements

  • A valid PostgreSQL connection must be established
  • The table name must be valid and exist in the database
  • The table data must be properly formatted
  • If using transactions, a valid transaction ID must be provided

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Connection Id
  • Connection Id not found in the connections dictionary
  • Empty or invalid Table Name
  • Invalid table data format
  • Transaction Id not found in the transactions dictionary
  • Both Conflict Column Name and Conflict Constraint Name are provided when using Replace
  • Both Conflict Column Name and Conflict Constraint Name are empty when using Replace
  • Ignore Conflicts and Replace options are both selected

Usage Notes

  • The Table Data input should be provided as a properly formatted table structure
  • When using the Replace option, either Conflict Column Name or Conflict Constraint Name must be specified, but not both
  • The Ignore Conflicts and Replace options cannot be used simultaneously
  • When using transactions, the transaction must be committed using the Commit Transaction node
  • The Column Names with Special Characters option should be used when column names contain special characters