Search Postgresql Archives

Re: How to delete duplicate rows?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<johnsw@xxxxxxxxxxxxx> wrote:
> 
> 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?
 
Yes. It could work. I have a two hours window to do it. Creating the
index alone takes about one hour...

> Clodoaldo Pinto wrote:
> 
> > 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.
> >
How did i wrote it? The correct is:

Insert the distinct rows in a temporary table. Truncate the original.
Drop the index. Insert into the original from the temporary.  Recreate
the index.

Clodoaldo

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux