Received: from slip1.raccoon.com (slip1.raccoon.com [165.90.135.16]) by hub.org (8.9.3/8.9.1) with ESMTP id OAA11135 for ; Sun, 25 Apr 1999 14:04:00 -0400 (EDT) (envelope-from perdue@raccoon.com) Received: from timnt (tim.desmoinesnet.com [165.90.140.11]) by slip1.raccoon.com (8.8.7/8.8.7) with SMTP id MAA11944 for ; Sun, 25 Apr 1999 12:59:23 -0500 Message-ID: <000c01be8f45$6c334f90$0b8c5aa5@timnt.weather.net> Reply-To: "Tim Perdue" From: "Tim Perdue" To: Subject: Primary Key Bugs Date: Sun, 25 Apr 1999 12:59:53 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Somehow I have records in my database with duplicate primary keys. Because of this, I'm not able to update a lot of records, because Postgres then complains that I'm trying to insert a duplicate primary key. Can anyone suggest a way to select the duplicate ids out of the table so I can change them? I can't really do a SELECT DISTINCT on a 3GB database table or my machine would likely go down. Basically, I just want a query like this: select * into tbl_tmp from tbl_mail where mailid is duplicated 8-) Any suggestions? Tim Perdue PHPBuilder.com / GotoCity.com / Geocrawler.com