Re: mass import to table with unique index

From: "Shridhar Daithankar" <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: mass import to table with unique index
Date: 2003-01-30 07:12:57
Message-ID: 3E391DD1.21800.35C5627@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 29 Jan 2003 at 15:00, John Smith wrote:

>
> Is there a way to mass import (like COPY, INSERT INTO ... SELECT ...) data into
> an existing table with existing data that has a unique index?
> Such as importing data with SSNs, and there's a unique index on the SSN column.
> MySQL has an 'IGNORE' option for mass imports. Any way with PostgreSQL? Or only
> with an INSERT command for each record?

I don't understand. Why wouldn't copy work in this case? It does insert only
and it does check index, if I am not making a mistake.

I am not sure you want the contraint in place while it is mass importing. You
can always drop the index, mass import data and recreate index if you are sure
what you are doing..

Bye
Shridhar

--
Fourth Law of Revision: It is usually impractical to worry beforehand about
interferences -- if you have none, someone will make one for you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dann Corbit 2003-01-30 07:16:25 Re: mass import to table with unique index
Previous Message Shridhar Daithankar 2003-01-30 07:10:40 Re: how much memory to allot to postgres?