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

ParameterTypeDefaultDescription
operationselectqueryquery returns rows as items; execute runs a statement and returns its status.
sqlstringThe statement, with $1..$n placeholders. Expression-enabled per item.
paramslist[]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 typeArrives as
timestamp / date / timeISO 8601 string
numericlossless string ("1.50") — same as node-postgres
floatnumber; nan/inf become strings
uuidstring
byteahex string
arrayJSON array
json / jsonbits text form — parse downstream if you need the object
interval and other exoticsstring

Quirks & tips

  • Binding is strict about types. WHERE n = $1 with 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.
  • execute without 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 jsonb string or reshape rows.
  • IF / Filter — route on the returned columns.
  • HTTP Request — for databases fronted by an API instead.