Search Postgresql Archives

Re: OID's

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

 



On Tue, 2004-11-16 at 12:32, Holger Klawitter wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> A little bit OT, but:
>   is there a way of removing duplicate rows in a table without OIDs? 
> 

ALTER TABLE ... ADD COLUMN myoid int;
CREATE TEMP SEQUENCE myoidsequence;
UPDATE ... SET myoid=nextval('myoidsequence'); 

then do the usual 

SELECT a.* FROM ... a, ... b WHERE a.something=b.something AND
a.myoid<b.myoid;

Dance and if you are done with it,
ALTER TABLE ... DROP COLUMN myoid;
DROP TEMP SEQUENCE myoidsequence;

HTH
Tino


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

[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