Re: Question on Insert / Update - Mailing list pgsql-general

From A. Kretschmer
Subject Re: Question on Insert / Update
Date
Msg-id 20051109152051.GS30305@webserv.wug-glas.de
Whole thread Raw
In response to Question on Insert / Update  (Alex <alex@meerkatsoft.com>)
Responses Re: Question on Insert / Update
List pgsql-general
am  10.11.2005, um  1:45:46 +1100 mailte Alex folgendes:
> 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.

Take a look at
http://developer.postgresql.org/docs/postgres/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING



HTH, Andreas
--
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47212,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    ===

pgsql-general by date:

Previous
From: Csaba Nagy
Date:
Subject: Re: Question on Insert / Update
Next
From: Tom Lane
Date:
Subject: Re: insert on duplicate update?