-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [EMAIL PROTECTED] wrote: > Thanks.... > CTAS (Create Table As Select) command works fine!!! With great performance. > I think it is the best way to correct the data...(apparently) > I didnt know about "select DISTINCT". I am going to read about it.
You might want to wrap this in some locking and throw in some constraints to avoid dupes in the future... BEGIN; LOCK lanctos IN ACCESS EXCLUSIVE; CREATE TABLE lanctos_distinct AS SELECT DISTINCT * FROM lanctos; DROP TABLE lanctos; ALTER TABLE lanctos_distinct RENAME TO lanctos; ALTER TABLE lanctos ALTER id SET NOT NULL; CREATE UNIQUE INDEX lanctos_id_idx ON lanctos (id); ALTER TABLE lanctos ADD CONSTRAINT lanctos_id_pkey PRIMARY KEY (id); COMMIT; As always, don't forget to ANALYZE the new table. - -- Andrew Hammond 416-673-4138 [EMAIL PROTECTED] Database Administrator, Afilias Canada Corp. CB83 2838 4B67 D40F D086 3568 81FC E7E5 27AF 4A9A -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFClfpbgfzn5SevSpoRAnj3AJ9xvCmMiC9yWNmS9XLFZWO3o4vNcACfboz+ T442LzdAAV1DbIoj24rCJeA= =vrDU -----END PGP SIGNATURE----- ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly