Thank you for details.
We do not provide end-to-end user package configuration, however can provide general assistance.
EmailHash, ListId, Action and Timestamp are primary key columns.
In order to perform UPSERT, you need to undertake these actions:
1. Remove primary key attribute from these columns (EmailHash, ListId, Action, Timestamp) in your PostgreSQL database.
2. Create a new auto-generated column with type "serial" and primary key attribute.
3. Configure a lookup as shown on the screenshot. Don't forget to select the "Set null when no match found" check box as shown on the step 8 here.
Please map four columns - EmailHash, ListId, Action, Timestamp - with a simple column mapping.
We are looking forward to hearing from you, should you require any further assistance.