unique rows

From: TJ O'Donnell <tjo(at)acm(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: unique rows
Date: 2006-09-21 05:18:04
Message-ID: 4512208C.9050607@acm.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message dmz 2006-09-21 06:13:07 UnSubscribe
Previous Message vijay balan 2006-09-21 04:47:34 UnSubscribe