Can COPY update or skip existing records?

From: "Glenn Gillen" <glenn(dot)gillen(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Can COPY update or skip existing records?
Date: 2008-09-30 12:16:06
Message-ID: 69b2ac8a0809300516t3495c25y2d6a5e00f2c3377c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hey all,

I've got a table with a unique constraint across a few fields which I
need to regularly import a batch of data into. Is there a way to do it
with COPY without getting conflicts on the unique contraint? I have no
was of being certain that some of the data I'm trying to load isn't in
the table already.

Ideally I'd like it to operate like MySQL's on_duplicate_key_update
option, but for now I'll suffice with just ignoring existing rows and
proceeding with everything else.

Thanks,

--
Glenn

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Oliveiros Cristina 2008-09-30 12:21:09 Re: optimizing a query over tree-like structure
Previous Message az 2008-09-30 08:32:51 optimizing a query over tree-like structure