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.
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.
| Field | Required | Type | Description | Example |
| credentials_path | True | STRING | PostgreSQL connection URI specifying how to connect to the database. | postgres://:@db.example.com:5432/my_database |
| timeout | True | INT | Maximum time in seconds to wait for the database operation before failing. | 60 |
| sql_text | True | STRING | The 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
| Field | Type | Description | Example |
| result | STRING | Human-readable summary of the execution outcome (e.g., rows affected). | PostgreSQL Execute Results: 1 row affected |
| json_result | STRING | JSON-formatted response containing structured details about the operation result. | {"status":"success","rows_affected":1} |
| html_table | STRING | HTML table representation of the result when available. For non-SELECT statements, this may be an empty or minimal table. | |
| xlsx_data | STRING | Base64-encoded XLSX data of the result when applicable. Often minimal or empty for non-SELECT statements. | |
| pdf_data | STRING | Base64-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.