Re: ON CONFLICT clause NOT working on Partition Table PostgreSQL 12 - Mailing list pgsql-sql

From Steve Midgley
Subject Re: ON CONFLICT clause NOT working on Partition Table PostgreSQL 12
Date
Msg-id CAJexoS+F37aQStLD4chj51EhtLyUWFNTtC4Vduq4XqR_bFwYCQ@mail.gmail.com
Whole thread Raw
In response to ON CONFLICT clause NOT working on Partition Table PostgreSQL 12  (Inzamam Shafiq <inzamam.shafiq@hotmail.com>)
Responses Re: ON CONFLICT clause NOT working on Partition Table PostgreSQL 12  (Inzamam Shafiq <inzamam.shafiq@hotmail.com>)
List pgsql-sql


On Thu, Sep 15, 2022 at 6:32 PM Inzamam Shafiq <inzamam.shafiq@hotmail.com> wrote:

Hi Team,

I have a partitioned table in postgresql12 and the unique constraint is applied on the child tables, when I use ON CONFLICT clause it returned an error "duplicate key value violates unique constraint "..."", I tried to replicate the scenario on a test table and created a unique index on partition column and the unique column but when I try to insert data it again return the same error. 

This works successfully when I directly insert data in the child table.

What could be the way forward to get this work on parent table?

Please send DDL, sample data (ideally as inserts), and the sql statement that causes the error. Given your description of the problem, I think if you do that, you'll find people on this list solve the issue very quickly for you. Without that, it's hard to diagnose, at least for me.

Best,
Steve

pgsql-sql by date:

Previous
From: Inzamam Shafiq
Date:
Subject: ON CONFLICT clause NOT working on Partition Table PostgreSQL 12
Next
From: Inzamam Shafiq
Date:
Subject: Re: ON CONFLICT clause NOT working on Partition Table PostgreSQL 12