integrations.postgres
Postgres (integrations.postgres)
Run SQL against any PostgreSQL database. Values are always bound through `$1..$n placeholders — never string-interpolated — so an injection attempt arrives as a harmless literal.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
operation | select | query | query returns rows as items; execute runs a statement and returns its status. |
sql | string | — | The statement, with $1..$n placeholders. Expression-enabled per item. |
params | list | [] | Values bound to the placeholders, in order. Each entry is expression-enabled; a bare scalar is accepted and wrapped. |
Credential: a postgres credential (host, port, database, user, password).
One connection pool per credential, 30s statement timeout.
Behavior
query emits one item per row (columns = keys, paired_item → the input
item that ran the statement). Zero rows → zero items. execute emits one
{success, status} item per input.
Driver-native values are converted to JSON-safe forms at the boundary:
| Postgres type | Arrives as |
|---|---|
timestamp / date / time | ISO 8601 string |
numeric | lossless string ("1.50") — same as node-postgres |
float | number; nan/inf become strings |
uuid | string |
bytea | hex string |
array | JSON array |
json / jsonb | its text form — parse downstream if you need the object |
interval and other exotics | string |
Quirks & tips
- Binding is strict about types.
WHERE n = $1with the string"5"fails with a clear error — cast in SQL ($1::int) or send a real number. - Wrong placeholder count is a clean node error, never a silent no-op.
executewithout params runs semicolon-separated multi-statement scripts whole (handy for setup flows). With params, the statement is prepared — single statement only.- Numeric strings still compare fine in IF/Filter/Switch — the condition
system coerces
"1.50"numerically. - Error messages carry the SQL context, never credential fields.
Related
- Code — parse a
jsonbstring or reshape rows. - IF / Filter — route on the returned columns.
- HTTP Request — for databases fronted by an API instead.