Re: [HACKERS] MERGE-esque Functionallity (was: Adding MERGE to the TODO list (resend with subject))

From: Mike Rylander <miker(at)purplefrog(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: <pgsql-general(at)postgresql(dot)org>, "postgres SQL" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: [HACKERS] MERGE-esque Functionallity (was: Adding MERGE to the TODO list (resend with subject))
Date: 2004-05-14 18:04:20
Message-ID: 200405141402.07429.miker@purplefrog.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-sql

On Tuesday 11 May 2004 09:44 am, Bruce Momjian wrote:
[snip]
> > > > Bruce Momjian kirjutas E, 10.05.2004 kell 06:58:
> > > > > Added to TODO:
> > > > >
> > > > > * Add MERGE command that does UPDATE, or on failure, INSERT
> > > >
[snip]

Hello all.

I have been lurking here for a bit and the MERGE topic (on [HACKERS]) caught
my eye, so I had a go at implementing a basic version of MERGE-on-INSERT in
pl/pgsql. It is attached below, and any comments are welcome. I find it
useful on "status" type tables, though it is not very nice when there are
many clients (table locking to avoid race conditions).

Hope someone will find it useful!

-miker

Attachment Content-Type Size
merge_on_insert.sql text/x-sql 2.4 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vivek Khera 2004-05-14 18:36:53 Re: pg_xlog becomes extremely large during CREATE INDEX
Previous Message Smitty 2004-05-14 17:59:49 Re: Inserting NULL value into date datatype

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-05-14 18:23:32 Feature freeze approaching
Previous Message Simon Riggs 2004-05-14 17:54:31 Re: database errors

Browse pgsql-sql by date

  From Date Subject
Next Message Theodore Petrosky 2004-05-15 13:42:47 Re: where is this problem (trigger)
Previous Message Eric Anderson Vianet SAO 2004-05-14 17:17:13 view running query