Re: Delete duplicates - Mailing list pgsql-sql

From Dani Oderbolz
Subject Re: Delete duplicates
Date
Msg-id 3EF95A63.6070609@ecologic.de
Whole thread Raw
In response to Re: Delete duplicates  ("Denis Arh" <denis@exonium.net>)
List pgsql-sql
Denis Arh wrote:

>How to delete "real" duplicates?
>
>id | somthing
>-----------------------
>1 | aaa
>1 | aaa
>2 | bbb
>2 | bbb
>
>(an accident with backup recovery...)
>
In these cases, its certainly the best to rebuild your table
using a

CREATE TABLE new AS
SELECT col1,col1..
FROM old
GROUPY BY col1,col2...

If you have got many duplicates, recreating a new table
semms better to me than deleteing.
(Another advantage is that you still have the "bad" table as a record).

Cheers,
Dani






pgsql-sql by date:

Previous
From: "Frankie Lam"
Date:
Subject: Re: database & table size
Next
From: Dani Oderbolz
Date:
Subject: Re: TR: Like and =