pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Worky Workerson <worky.workerson@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Bulk loading/merging
Date: Tue, 30 May 2006 20:09:22 -0500
Message-ID: <20060531010922.GC59464@pervasive.com> (raw)
In-Reply-To: <ce4072df0605261148g4ec22267gc54b6b445e47c855@mail.gmail.com>
References: <ce4072df0605261148g4ec22267gc54b6b445e47c855@mail.gmail.com>

Your best bet is to do this as a single, bulk operation if possible.
That way you can simply do an UPDATE ... WHERE EXISTS followed by an
INSERT ... SELECT ... WHERE NOT EXISTS.

On Fri, May 26, 2006 at 02:48:20PM -0400, Worky Workerson wrote:
> I've set up something similar the 'recommended' way to merge data into
> the DB, i.e.
> 
> http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
> 
> however I did it with a trigger on insert, i.e. (not my schema :) ):
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



view thread (6+ messages)  latest in thread

Message-ID: <20060531010922.GC59464@pervasive.com>
Permalink:  ../20060531010922.GC59464@pervasive.com/
Also on:    postgresql.org/message-id/20060531010922.GC59464@pervasive.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jnasby@pervasive.com, worky.workerson@gmail.com
  Subject: Re: Bulk loading/merging
  In-Reply-To: <20060531010922.GC59464@pervasive.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox