Skip to content

PostgreSQL Execute

Executes non-SELECT SQL statements (INSERT, UPDATE, DELETE, DDL) on a PostgreSQL database. It connects using a credentials URI and returns a human-readable result summary along with machine-friendly JSON and tabular renderings where applicable.
Preview

Usage

Use this node when you need to perform write or administrative operations against a PostgreSQL database, such as inserting records, updating rows, deleting data, or running DDL (e.g., CREATE TABLE). Provide a valid PostgreSQL credentials URI, set an appropriate timeout, and supply the SQL statement to execute. Typically placed after configuration/credential nodes and before any nodes that depend on the execution outcome.

Inputs

FieldRequiredTypeDescriptionExample
credentials_pathTrueSTRINGPostgreSQL connection URI specifying how to connect to the database.postgres://:@db.example.com:5432/my_database
timeoutTrueINTMaximum time in seconds to wait for the database operation 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
resultSTRINGHuman-readable summary of the execution outcome (e.g., rows affected).PostgreSQL Execute Results: 1 row affected
json_resultSTRINGJSON-formatted response containing structured details about the operation result.{"status":"success","rows_affected":1}
html_tableSTRINGHTML table representation of the result when available. For non-SELECT statements, this may be an empty or minimal table.
rows_affected
1
xlsx_dataSTRINGBase64-encoded XLSX data of the result when applicable. Often minimal or empty for non-SELECT statements.
pdf_dataSTRINGBase64-encoded PDF data of the result when applicable. Often minimal or empty for non-SELECT statements.

Important Notes

  • Non-SELECT focus: This node is intended for INSERT/UPDATE/DELETE/DDL statements; use query-oriented nodes for SELECT operations.
  • Credentials required: A valid PostgreSQL credentials URI must be provided or the node will fail.
  • Timeouts: Long-running statements should have an appropriately increased timeout to avoid premature failure.
  • Safety: Avoid concatenating untrusted input into SQL to prevent SQL injection vulnerabilities.
  • Result formats: Tabular/Excel/PDF outputs may be minimal for non-SELECT operations since they typically produce metadata rather than row sets.
  • Permissions: Ensure the provided database user has sufficient privileges for the intended operation.

Troubleshooting

  • Invalid credentials or URI: Verify the credentials_path format and values (host, port, database, username, password).
  • SQL syntax error: Validate the sql_text against PostgreSQL syntax; test the statement directly in a SQL client.
  • Timeouts: Increase the timeout input for heavy operations or ensure the database is responsive.
  • Insufficient privileges: Confirm the database user has the necessary permissions to execute the statement.
  • Connectivity issues: Check network access, firewall rules, and that the PostgreSQL instance is reachable on the specified host/port.