Writing ON CONFLICT Clauses on Partial Indexes using GORM

Introduction PostgreSQL&rsquo;s ON CONFLICT clause is a useful construct that allows you to handle cases where an insertion may violate a uniqueness constraint. It is not standard SQL syntax, but an extension, like SQLite&rsquo;s INSERT OR REPLACE . Let&rsquo;s say we have a table named tasks like this: create table if not exists tasks ( account_id integer not null , task_name text not null ,…