You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Create a workflow in n8n.
Add a PostgreSQL node.
Set the operation to "Execute Query".
Use the query:
select '$1'
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
The text was updated successfully, but these errors were encountered:
Thanks for the report, I have managed to reproduce this and have created NODE-1416 as the internal ticket to get this fixed. Out of interest and so we can set a priority to it... Do you use $x a lot in your queries?
I think this issue is critical for PostgreSQL becasue the issue prevents the execution of very common SQL such as the following example: insert into comments (id, text) values (2, "His efforts have resulted in a $1000 salary increase.”)
Of course, this problem can be bypassed by using a PREPARED STATEMENT as follows. insert into comments (id, text) values (2, $1)
Query parameters: "His efforts have resulted in a $1000 salary increase.”
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:
Error Message:
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
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
The text was updated successfully, but these errors were encountered: