Found a bug with postgres. Previously, "Insert or Update" worked, but now it doesn't

Found a bug with postgres.
Previously, “Insert or Update” worked, but now it doesn’t.

Select:

Upsert:

Information on your n8n setup

  • n8n version: 1.86.1
  • Database: postgres:14.3-alpine
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Windows 11

hello @boan

Have you tried to use the Update operation?

It’s working. But that’s not what I need.

I need to insert records only if they are not in the database. Otherwise, I need to update the existing ones.

I may assume that the value 1, which you are using as matching value, it not of the number type, so it tries to insert another id with value "1".

Can you try setting it in the expression mode with an expression {{ 1 }} ?

Everything is the same.

Is there a bug fix?

Can confirm that the insert or update postgres node does not allow to 1. update rows if they exist based on the id provided 2. insert new ones if no previous ones exist.
I am forced to use the execute query node instead. While this is not that big of a deal, it’s quite time consuming to write those queries, especially if there are a lot of columns in the postgres table.

Would you like to create a bug for this issue here?