how do I capture conflicting rows

From: Nikhil Ingale <niks(dot)bgm(at)gmail(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: how do I capture conflicting rows
Date: 2023-05-15 05:32:00
Message-ID: CALXkTpx3iLuGRx1_4N6GJ85ptoW4n4XSdh3ChJLE-hrFGC982g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi All,

The following query inserts the rows by ignoring the rows that has
conflicts.

INSERT INTO test (id,name,age,branch) SELECT * FROM student ON CONFLICT DO
NOTHING;

How do I capture the conflicting records to a file while non conflicting
records are inserted to the table?

Regards,
Nikhil Ingale

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ron 2023-05-15 06:09:24 Re: how do I capture conflicting rows
Previous Message Nikhil Ingale 2023-05-15 05:26:09 Re: Find out the indexed columns