Re: How to delete duplicate rows? - Mailing list pgsql-general

From John Sidney-Woollett
Subject Re: How to delete duplicate rows?
Date
Msg-id 42034DFE.6060502@wardbrook.com
Whole thread Raw
In response to How to delete duplicate rows?  (Clodoaldo Pinto <clodoaldo.pinto@gmail.com>)
Responses Re: How to delete duplicate rows?
List pgsql-general
Doh, sorry - you're completely correct! Silly me...

Can you not add a serial or sequence column to the table for the
purposes of the de-dupe?

Then create an index on that column in one operation at the end and use
that in the way that you would use Oracle's rowid from the examples?

John Sidney-Woollett


Clodoaldo Pinto wrote:

> On Fri, 04 Feb 2005 07:38:26 +0000, John Sidney-Woollett
> <johnsw@wardbrook.com> wrote:
>
>>Can you not use your table's primary key value instead?
>>
>
> John, If a primary key existed there would be no duplicates.
>
> The row insertion is made in 650k rows batches 8 times a day and a
> primary key make it very slow.
>
> Found also methods 2 and 3 in
> http://www.orafaq.com/faq/Server_Utilities/SQL/faq55.htm
>
> Method 3 also relies in the row id. If no one can help I will do this:
>
> Insert the distinct rows in a temporary table. Drop the index. Insert
> into the original from the temporary.
>
> Clodoaldo

pgsql-general by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: pgpool 2.5b2 released
Next
From: Alban Hertroys
Date:
Subject: Re: Invalid headers and xlog flush failures