Question on Insert / Update

From: Alex <alex(at)meerkatsoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Question on Insert / Update
Date: 2005-11-09 14:45:46
Message-ID: 43720B9A.10907@meerkatsoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
have just a general question...

I have a table of 10M records, unique key on 5 fields.
I need to update/insert 200k records in one go.

I could do a select to check for existence and then either insert or update.
Or simply insert, check on the error code an update if required.

The 2nd seems to be to logical choice, but will it actually be faster
and moreover is that the right way to do it?

Thanks
Alex

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2005-11-09 14:52:48 Re: How to obtain the code af a function ?
Previous Message Csaba Nagy 2005-11-09 14:40:54 Re: How to obtain the code af a function ?