Postgres node: Execute query with query parameters is not working

Hi,
I’m having the problem that when I execute a SQL query with Query parameters, the query fails. However, when I provide the values, the query works fine. See the screenshots:
Query runs without query params…

but fails when using query params:

What I tried:

  • query params with and without brackets
  • table name (query param 1) with and without backticks ``
  • query param2 with/without brackets in the query ($2) vs $2

even when trying to select * from the table with query param fails…

By the way, I am actually using the “Execute Query” operation of the postgres node, because the SELECT operation of the node does not accept the “IN” operator when selecting rows based on multiple ids.

Anyone an idea why it’s not working?

Information on your n8n setup

  • n8n version: 1.38.2
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker

hello @strongbow

My assumption that the issue is with the $json.dataset, because it has the comma delimiter so the node assumes that you have entered 5 parameters instead of 2

I thought so first, too. But as you can see on the last screenshot, it also fails if there is no array, so this can‘t be the reason.