Re: OID's

From: "Sim Zacks" <sim(at)nospam(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: OID's
Date: 2004-11-16 13:32:48
Message-ID: cncvkk$n8l$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

If you have a primary key you can self join the table on the rows that would
define a table as duplicate and delete the one with a higher primary key
field. If the table is related to other tables (ie the pk is an fk in
another table) you have to make sure you update all the rows to point to the
new key.

If there is no pkey, then you would do a select distinct into a temp table
as was suggested by Michael in the post above mine

"Holger Klawitter" <lists(at)klawitter(dot)de> wrote in message
news:200411161232(dot)17642(dot)lists(at)klawitter(dot)de(dot)(dot)(dot)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A little bit OT, but:
is there a way of removing duplicate rows in a table without OIDs?

Mit freundlichem Gru / With kind regards
Holger Klawitter
- --
lists <at> klawitter <dot> de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFBmeVA1Xdt0HKSwgYRAklNAJ4l0KtMVF2Tkhx5ZgyPR38LHXd/LACeNk4q
mwf/f5rI7VdckPfgfUotnSc=
=qpV0
-----END PGP SIGNATURE-----

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

In response to

  • Re: OID's at 2004-11-16 11:32:07 from Holger Klawitter

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-11-16 13:35:39 Re: PL/pgsql - getting row from record
Previous Message Tino Wildenhain 2004-11-16 13:32:29 Re: 24x7x365 high-volume ops ideas