Re: how do I capture conflicting rows - Mailing list pgsql-admin

From Scott Ribe
Subject Re: how do I capture conflicting rows
Date
Msg-id 36F0306C-E96A-4516-B36E-E97612C95F59@elevated-dev.com
Whole thread Raw
In response to Re: how do I capture conflicting rows  (Nikhil Ingale <niks.bgm@gmail.com>)
Responses Re: how do I capture conflicting rows
List pgsql-admin
> On May 15, 2023, at 12:25 AM, Nikhil Ingale <niks.bgm@gmail.com> wrote:
>
> Thing is there is a list of tables (350+ tables) on which I'm running the insert query i.e., INSERT INTO table ON
CONFLICTDO NOTHING to continue inserting the records by ignoring the conflicting rows. But, at the same time I would
liketo capture the conflicting rows or every single conflicting column (not just the PK's) and their values for every
singletable. 

Create a "staging" table without constraints. Load all rows into it. Query for conflicts and report to user. Delete
conflictingrows. Then INSERT INTO ... SELECT * FROM ... 




pgsql-admin by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: how do I capture conflicting rows
Next
From: Mukesh Rajpurohit
Date:
Subject: Re: how do I capture conflicting rows