Hello, i’m having a hard time understanding possibility of achieving “on conflict do nothing” behavior with DBT.
I have a predefined PostgreSQL table with an unique two-column index - CREATE UNIQUE INDEX my_index ON my_table USING btree (col1, col2);. Now i want to make an incremental model on the top of this table.
The problem is that I want to ignore all insert conflict while building the model.
With PostgreSQL it looks smth like insert into table (....) values(....) on conflict(col1,col2) do nothing;

I’ve seen ‘unique_key’ and ‘incremental_strategy’ options, but they are not much of a help

Is there any way?

I believe Postgresql supports merge strategy. in that case, this piece of code should work.

{{  config(    
materialized = 'incremental',   
 unique_key = 'id',    
merge_update_columns = ['email', 'ip_address']  

The above is not the same as “ON CONFLICT DO NOTHING”, rather it is “ON CONFLICT DO UPDATE”, which in my personal opinion is better.
But in case it doesn’t work for you and you specifically want to have your own way of insertion, I believe you have to write your own incremental macro. Check out this page.