Search Postgresql Archives

Re: OID's

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx> wrote in message
news:200411161232.17642.lists@xxxxxxxxxxxxxxx
-----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@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly



---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux