Primary Key Bugs

From: "Tim Perdue" <perdue(at)raccoon(dot)com>
To: <pgsql-sql(at)hub(dot)org>
Subject: Primary Key Bugs
Date: 1999-04-25 17:59:53
Message-ID: 000c01be8f45$6c334f90$0b8c5aa5@timnt.weather.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 1999-04-26 07:31:19 Re: [SQL] PL/pgsql questions..
Previous Message tveith 1999-04-25 17:10:34 PL/pgsql questions..