Re: [INTERFACES] Deleting duplicate records - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: [INTERFACES] Deleting duplicate records
Date
Msg-id 24023.944589714@sss.pgh.pa.us
Whole thread Raw
In response to Deleting duplicate records  ("Paul S. Ganney" <paul.ganney@dial.pipex.com>)
List pgsql-interfaces
"Paul S. Ganney" <paul.ganney@dial.pipex.com> writes:
> I've managed to get some duplicate records in a table and am having 
> problems getting rid of them (as there's nothing unique to SELECT on). 
> Any ideas?

There's always the OID.  Doselect oid,* from table ...
to see it, and get rid of the unwanted rows withdelete from table where oid = nnnn;

> And whilst I'm at it - any ideas on a scheme for preventing duplicates?

Unique index on whatever combination of fields is your primary key?
        regards, tom lane


pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: [INTERFACES] locking on database updates
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: [INTERFACES] locking on database updates