X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id EFECA9FB2C8 for ; Thu, 21 Sep 2006 02:18:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 58609-06 for ; Thu, 21 Sep 2006 05:18:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from dukecmmtar01.coxmail.com (dukecmmtar01.coxmail.com [68.99.120.48]) by postgresql.org (Postfix) with ESMTP id 0EE6E9FA2A0 for ; Thu, 21 Sep 2006 02:18:06 -0300 (ADT) Received: from [192.168.1.200] (really [70.166.0.90]) by dukecmmtar01.coxmail.com (InterMail vM.6.01.06.01 201-2131-130-101-20060113) with ESMTP id <20060921051806.PSEX5504.dukecmmtar01.coxmail.com@[192.168.1.200]> for ; Thu, 21 Sep 2006 01:18:06 -0400 Message-ID: <4512208C.9050607@acm.org> Date: Wed, 20 Sep 2006 22:18:04 -0700 From: TJ O'Donnell User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: unique rows Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.315 tagged_above=0 required=5 tests=SARE_MILLIONSOF X-Spam-Level: X-Archive-Number: 200609/145 X-Sequence-Number: 26356 I want to make a table that has unique rows - no problem. Create Table x (smarts Varchar Unique); I have input data that has many duplicates and until now I was creating a temp table allowing duplicates, and then Insert into x (smarts) select distinct smarts from tmpx; This is now failing when I have hundreds of millions of rows, running out of temp space (while trying to sort to accomplish the distinct?) So, is there a way (a constraint, a check?) that will simply REJECT a duplicate when I insert the raw data directly into x rather than FAILING on an error as it does with the unique constraint above? Thanks, TJ O'Donnell