pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dani Oderbolz <oderbolz@ecologic.de>
To: pgsql-sql@postgresql.org
Subject: Re: Delete duplicates
Date: Wed, 25 Jun 2003 10:16:35 +0200
Message-ID: <3EF95A63.6070609@ecologic.de> (raw)
In-Reply-To: <00ac01c33946$8d1678e0$0a00000a@neo>
References: <20030622091522.M37248@oasis.net.au>
	<2976.200.59.66.253.1056316636.squirrel@webmail.akyasociados.com.ar>
	<00ac01c33946$8d1678e0$0a00000a@neo>

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







view thread (10+ messages)

Message-ID: <3EF95A63.6070609@ecologic.de>
Permalink:  ../3EF95A63.6070609@ecologic.de/
Also on:    postgresql.org/message-id/3EF95A63.6070609@ecologic.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: oderbolz@ecologic.de
  Subject: Re: Delete duplicates
  In-Reply-To: <3EF95A63.6070609@ecologic.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox