Skip to content

PostgreSQL Execute

Runs non-SELECT SQL statements (INSERT, UPDATE, DELETE, DDL) against a PostgreSQL database using provided credentials. Loads credentials from a path, sends the SQL to the PostgreSQL service for execution, and returns a human-readable summary along with a JSON payload.
Preview

Usage

Use this node when you need to modify data or schema in PostgreSQL as part of a workflow (e.g., inserting new records, updating fields, deleting rows, creating tables). Typically, connect it after a credentials/connection provider and before any nodes that depend on the outcome of the write operation.

Inputs

FieldRequiredTypeDescriptionExample
credentials_pathTrueNot specifiedPath or reference to the stored PostgreSQL credentials to use for authentication.
timeoutFalseNot specifiedMaximum time in seconds to wait for the execution request to complete before failing.60
sql_textTrueSTRINGThe SQL statement to execute. Intended for INSERT/UPDATE/DELETE or other non-SELECT operations.INSERT INTO users (name, email) VALUES ('John Doe', 'john@example.com')

Outputs

FieldTypeDescriptionExample
textNot specifiedHuman-readable execution summary (e.g., success message, affected rows).PostgreSQL Execute Results: 3 rows affected
jsonNot specifiedMachine-readable JSON response from the execution, which may include status, affected row count, or error details.{"status": "success", "row_count": 3}

Important Notes

  • Do not use this node for SELECT queries; use the PostgreSQL Query node instead.
  • Ensure the provided credentials have sufficient privileges for the statements being executed.
  • Long-running or large batch operations may require increasing the timeout input.
  • The node formats results with a default text summary and a JSON payload; downstream nodes can parse the JSON for programmatic handling.
  • Always validate and sanitize dynamic SQL to avoid accidental destructive operations.

Troubleshooting

  • SQL syntax error: Verify the sql_text statement compiles in your database and includes correct schema/table names.
  • Permission denied: Confirm the credentials have the required INSERT/UPDATE/DELETE or DDL privileges.
  • Timeouts: Increase the timeout input or optimize the query/operation to complete faster.
  • Invalid credentials path: Make sure credentials_path points to a valid and accessible credential file/reference.
  • No rows affected: Confirm WHERE clauses and target tables; test the statement directly in the database to verify expected impact.