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


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to