Docs
NodesDatabase Nodes
Edit Page on GitHub

PostgreSQL - Custom Query

Executes a custom SQL query with parameters. For advanced users.

postgresdatabasecustomsqlrawHard5
PostgreSQL - Custom Query Node Screenshot

Description

The PostgreSQL - Custom Query node allows you to execute any SQL query on your PostgreSQL database. This node is designed for advanced users who need more flexibility than the standard query nodes provide. You can write complex SQL statements, including joins, subqueries, and transactions.

Common Use Cases

  • Execute complex queries that involve multiple tables
  • Perform database maintenance tasks
  • Run batch updates or deletes based on specific conditions

Inputs

The input connections this node accepts:

NameDescriptionTypeFlowThe flow of the workflowFlowQueryThe raw SQL query to execute, using $1, $2, etc. for placeholdersTextParametersThe values for the placeholders in the queryText[]

Outputs

The output connections this node provides:

NameDescriptionTyperowsThe array of rows returned by the query (if any)JSONrowCountThe number of rows affected or returnedNumberToolThe tool version of this node, to be used by LLMsTool

Fields

The configurable fields this node provides:

NameDescriptionTypeQueryThe raw SQL query to execute, using $1, $2, etc. for placeholdersValue: SELECT * FROM users WHERE status = $1 LIMIT 10;TextAreaParametersThe values for the placeholders in the queryValue: Enter values here...Text[]PG_CONNECTION_STRINGPostgres connection stringDefaultValue: postgres://user:password@localhost:5432/dbnameenv

Last updated on