Postgresql select from database where id = '{{$node["Gmail"].json["id"]}}';

Hi Guys,
I try to use n8n to connect to my Gmail. After I detect a new email I check with PostgreSQL if that email id was already processed or not

This is the selection I RUN:
SELECT id FROM n8n_logs WHERE gmail_id = '{{$node["Gmail"].json["id"]}}';

While this is working fine when I limit the number of selected emails to 1, when I try to put limit 2 or more I get an error

image

If however, I select just to get 1 email Postgres selection works just fine:

image

What am I doing wrong and how can I make sure it will work well even when i run this for 10 - 20 emails in the same time

As an update, if I add Execute Once, it will work

image

It seems like the Postgres-Node is one of the ones which has currently still some issues to execute multiple items. For that reason do you have to use the SplitInBatches-Node.

Here an example workflow: