X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 796455285B for ; Wed, 25 May 2005 17:54:11 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 05420-04 for ; Wed, 25 May 2005 20:54:01 +0000 (GMT) Received: from iracema.dnscenter.com.br (iracema.dnscenter.com.br [67.15.81.98]) by svr1.postgresql.org (Postfix) with ESMTP id E10D552806 for ; Wed, 25 May 2005 17:54:00 -0300 (ADT) Received: from cpanel by iracema.dnscenter.com.br with local (Exim 4.51) id 1Db2t2-0005YZ-5O for pgsql-sql@postgresql.org; Wed, 25 May 2005 17:53:56 -0300 Received: from 200.148.63.230 ([200.148.63.230]) by www.presserv.org (Horde) with HTTP for ; Wed, 25 May 2005 17:53:56 -0300 Message-ID: <20050525175356.s6rowsmck8e888s8@www.presserv.org> Date: Wed, 25 May 2005 17:53:56 -0300 From: lucas@presserv.org To: pgsql-sql@postgresql.org Subject: Re: Duplicated records References: <20050524175931.4dp41vy7v10c4wc4@www.presserv.org> <20050525050346.GA29126@webserv.wug-glas.de> <20050525135807.x9p08co04v8gg0cw@www.presserv.org> <4294B149.3040207@PresiNET.com> In-Reply-To: <4294B149.3040207@PresiNET.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iracema.dnscenter.com.br X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [32001 502] / [47 12] X-AntiAbuse: Sender Address Domain - presserv.org X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.247 tagged_above=0 required=5 tests=AWL, NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200505/219 X-Sequence-Number: 21532 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. Thank you. Quoting Bricklen Anderson : >> Is there a way to delete those duplicated records faster??? Remembering the >> table have aprox 360.000 records... >> Is better I create other table and copy those data??? How should I >> created??? >> > for 180k rows (which isn't many) just do a CTAS (Create Table As Select): > > create table lanctos_distinct as select distinct * from lanctos; > truncate table lanctos; > alter table lanctos_distinct rename to lanctos; >