From: TJ O'Donnell <tjo@acm.org>
To: pgsql-sql@postgresql.org
Subject: unique rows
Date: Wed, 20 Sep 2006 22:18:04 -0700
Message-ID: <4512208C.9050607@acm.org> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tjo@acm.org
Subject: Re: unique rows
In-Reply-To: <4512208C.9050607@acm.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox