When configuring the upsert node, if the selected table doesn’t have a column named ‘id’, the table can’t be used. It just shows the message “No column that can be used for matching found in Postgres.”
For an example, create these two tables, and then only table1 will be possible to use with the upsert operation.
CREATE TABLE table1 (
id varchar(255),
datetime timestamp,
result BOOLEAN
);
CREATE TABLE table2 (
key varchar(255),
datetime timestamp,
result BOOLEAN
);
Is there a way to make the Postgres node upsert operation key on columns named other than ‘id’?
Hi @jzrts, this is a good question. n8n uses a specific query to find columns suitable for matching. The idea is to show only columns with unique values, making me wonder why the id column in your first example would be offered here.
I’ll add this to our bug tracker for a closer look and fix. In the meantime, perhaps you want to create your table2 like below?