Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA74690 for ; Tue, 7 Dec 1999 13:02:34 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id NAA24025; Tue, 7 Dec 1999 13:01:54 -0500 (EST) To: "Paul S. Ganney" cc: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] Deleting duplicate records In-reply-to: Your message of Tue, 07 Dec 1999 16:46:30 +0000 <384D39E6.6459@dial.pipex.com> Date: Tue, 07 Dec 1999 13:01:54 -0500 Message-ID: <24023.944589714@sss.pgh.pa.us> From: Tom Lane "Paul S. Ganney" 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. Do select oid,* from table ... to see it, and get rid of the unwanted rows with delete 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