Re: how to make duplicate finding query faster? - Mailing list pgsql-admin

From Scott Ribe
Subject Re: how to make duplicate finding query faster?
Date
Msg-id 84F2C1B0-3510-410B-8924-0EB7377684A9@elevated-dev.com
Whole thread Raw
In response to Re: how to make duplicate finding query faster?  (Sachin Kumar <sachinkumaras@gmail.com>)
List pgsql-admin
> On Dec 30, 2020, at 6:24 AM, Sachin Kumar <sachinkumaras@gmail.com> wrote:
>
> Yes, I am checking one by one because my goal is to fail the whole upload if there is any duplicate entry and to
informthe user that they have a duplicate entry in the file. 

That's not what I said, though. If you want to fail the whole copy, then you don't have to check one by one, just try
thecopy--assuming you have the correct constraints in place. 

Unless you want to tell the user *which* rows are duplicates, in which case you can try a variant on my prior
suggestion,copy into a temp table, use a join to find duplicates... 


pgsql-admin by date:

Previous
From: Sachin Kumar
Date:
Subject: Re: how to make duplicate finding query faster?
Next
From: John Scalia
Date:
Subject: Creating a materialized view causing blocks