From 435392cbfe150c5e85d092686b3b7e20273421cc Mon Sep 17 00:00:00 2001 From: Michael Kret <88898367+michael-radency@users.noreply.github.com> Date: Mon, 11 Dec 2023 17:34:24 +0200 Subject: [PATCH] fix(Postgres Node): Do not include id column in upsert fields selection if it's not unique (#7975) ## Summary Do not include id column in upsert fields selection if it's not unique Forum: https://community.n8n.io/t/postgres-node-insert-or-update-unique-column-name/32520 --- .../nodes-base/nodes/Postgres/v2/methods/resourceMapping.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Postgres/v2/methods/resourceMapping.ts b/packages/nodes-base/nodes/Postgres/v2/methods/resourceMapping.ts index ce2e29c513..08959acc6b 100644 --- a/packages/nodes-base/nodes/Postgres/v2/methods/resourceMapping.ts +++ b/packages/nodes-base/nodes/Postgres/v2/methods/resourceMapping.ts @@ -77,7 +77,7 @@ export async function getMappingColumns( id: col.column_name, displayName: col.column_name, required: col.is_nullable !== 'YES' && !isAutoIncrement, - defaultMatch: col.column_name === 'id', + defaultMatch: (col.column_name === 'id' && canBeUsedToMatch) || false, display: true, type, canBeUsedToMatch,