Postgres Node 2.5 ignores falsey query parameters

It looks like the new Postgres node (2.5) ignores falsey (0, null, maybe others) value query parameters.





Notice the 0-value params are ignored as if they don’t exist.

The exact same query+parameters work in an older node, Postgres 2.4.

This is on the latest n8n, community version, self-hosted via npm.

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Welcome to the community @Byron_Hsu :tada:
I haven’t been able to reproduce your issue on my end but it could be a bug.
Does it work as expected when you don’t use the Query Parameters option but include the parameters in the Query itself?
Also, could you maybe share how you’ve defined your search_job_return() function?

I can reproduce if the expression is a 0. This looks like a bug

1 Like

Thank you, just saw this. Let me know if more info is still needed!

I have the same bug on Postgress Node v2.5. Totally blocking me.
Do you plan a quick fix on it? Is it possible to go back to v2.4 in the meantime?

1 Like

The fix is in review and this is the relevant PR: fix(Postgres Node): Falsy query parameters ignored by michael-radency · Pull Request #10960 · n8n-io/n8n · GitHub

@Kevin_Lourd1 In the meantime, you can use the Postgres node v2.4 by changing the version in the node json by selecting the node, copying the node json into a text editor, and then changing the typeVersion to 2.4, then pasting the json back into your workflow again.

...
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.4,
...
1 Like

New version [email protected] got released which includes the GitHub PR 10960.