From: | Csaba Nagy <nagy(at)ecircle-ag(dot)com> |
---|---|
To: | "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> |
Cc: | Postgres general mailing list <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Question on Insert / Update |
Date: | 2005-11-09 15:36:21 |
Message-ID: | 1131550580.8979.14.camel@coppola.muc.ecircle.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Cristian Prieto | 2005-11-09 15:42:36 | Re: [HACKERS] Troubles with array_ref |
Previous Message | Ian Harding | 2005-11-09 15:26:58 | psql scripts |