n8n icon indicating copy to clipboard operation
n8n copied to clipboard

PostgreSQL Node: Fixed String $1 Misinterpreted as Placeholder in Execute Query Operation

Open tumf opened this issue 8 months ago • 3 comments

Bug Description

When using the PostgreSQL node in n8n with the "Execute Query" operation, if the query contains the fixed string $1, it is incorrectly interpreted as a placeholder, causing an error.

Example Query:

select '$1'

Error Message:

Variable $1 out of range. Parameters array length: 0
Failed query: select '$1'

This query, when executed directly in PostgreSQL, correctly returns the string $1. However, in n8n, it is treated as a placeholder, leading to the mentioned error.

To Reproduce

  1. Create a workflow in n8n.
  2. Add a PostgreSQL node.
  3. Set the operation to "Execute Query".
  4. Use the query:
    select '$1'
    
  5. Execute the workflow.

Expected behavior

The query select '$1' should return the string $1 when executed in the PostgreSQL node, similar to how it behaves when run directly in PostgreSQL.

Operating System

Ubuntu 24.04. LTS

n8n Version

1.44.1

Node.js Version

20.13.1

Database

PostgreSQL

Execution mode

queue

tumf avatar Jun 09 '24 02:06 tumf