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

From Csaba Nagy
Subject Re: Question on Insert / Update
Date
Msg-id 1131550580.8979.14.camel@coppola.muc.ecircle.de
Whole thread Raw
In response to Re: Question on Insert / Update  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
List pgsql-general
Quote from the link below:

"Tip:  A block containing an EXCEPTION clause is significantly more
expensive to enter and exit than a block without one. Therefore, don't
use EXCEPTION without need."

I would think this places an automatic save-point at the begin of the
block. I doubt this would give the best performance for the given
problem...

Cheers,
Csaba.

On Wed, 2005-11-09 at 16:20, A. Kretschmer wrote:
> 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


pgsql-general by date:

Previous
From: Ian Harding
Date:
Subject: psql scripts
Next
From: "Cristian Prieto"
Date:
Subject: Re: [HACKERS] Troubles with array_ref