Re: what is the PostgreSQL idiom for "insert or update"?

From: Robert Poor <rdpoor(at)gmail(dot)com>
To: Kenneth Marshall <ktm(at)rice(dot)edu>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: what is the PostgreSQL idiom for "insert or update"?
Date: 2011-03-16 16:23:45
Message-ID: AANLkTinVT=K7zLrqyDGtHFBkapVbq-odeeywenucGNT1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Ken:

On Wed, Mar 16, 2011 at 07:48, Kenneth Marshall <ktm(at)rice(dot)edu> wrote:
> On Wed, Mar 16, 2011 at 07:32:13AM -0700, Robert Poor wrote:
>> ...I would like to do efficient "bulk loading" of tables
>> using multi-row INSERT commands, ignoring unique records that are
>> already present, where 'uniqueness' is defined by key constraints.
>
> Here is the current documented method:
>
> http://www.postgresql.org/docs/9.0/static/plpgsql-control-structures.html

The construct at the bottom of the page looks promising. I'm loading
about 500 records in a single transaction; I'm not clear on how to
recast the merge_db() method to handle multiple records. Can you
elucidate? Thanks...

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Robert Poor 2011-03-16 16:31:14 Re: what is the PostgreSQL idiom for "insert or update"?
Previous Message Richard Broersma 2011-03-16 15:45:01 Re: what is the PostgreSQL idiom for "insert or update"?