Search code examples
postgresqlapache-nifi

How to fix an upsert script of a PutDatabaseRecord processor?


I'm working on an ETL that extracts data from Progress and stores it into PostgreSQL.

enter image description here

However; when I have duplicate keys, I'm having problems with my upsert.

The problem is that the component is creating an invalid script. As you can see, it is missing the double quotes. It needs to be: ON CONFLICT ("cdConstrucao")

enter image description here

My settings are :

enter image description here

enter image description here

Deplayed error :

enter image description here

Sample table :

enter image description here

Is there a way to fix it ?

Kind regards Juliano


Solution

  • I am not sure if you are still facing this issue. Try following 2 settings

    Statement Type: INSERT_IGNORE, 
    
    Translate Field Names: false