How to delete completely duplicate rows - Mailing list pgsql-general

From Janek Sendrowski
Subject How to delete completely duplicate rows
Date
Msg-id trinity-eb3eb934-ffcb-42f8-bb42-7841c964032f-1388578450214@3capp-webde-bs32
Whole thread Raw
Responses Re: How to delete completely duplicate rows
Re: How to delete completely duplicate rows
List pgsql-general
Hi,
 
I want to delete duplicates in my table. I've dropped the unique constraint to insert my data.
My id value is a hash calculated witch the values of the two other columns.
So I want to delete all columns, which are indentical, but keeping one.
 
DELETE FROM table t1 USING table t2 WHERE t1.id = t2.id AND t1.ctid > t2.ctid

But the oids aren't unique enough.
What else could I do?

Janek


pgsql-general by date:

Previous
From: "Janek Sendrowski"
Date:
Subject: Re: cast hex to int in plpgsql
Next
From: Erik Darling
Date:
Subject: Re: How to delete completely duplicate rows