Re: MERGE vs REPLACE

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: josh(at)agliodbs(dot)com, pgsql-hackers(at)postgresql(dot)org, Jaime Casanova <systemguards(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: MERGE vs REPLACE
Date: 2005-11-16 00:16:21
Message-ID: 200511160016.jAG0GLa11084@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Josh Berkus <josh(at)agliodbs(dot)com> writes:
> > But even REPLACE requires predicate locking. There's no real way to get
> > around it.
>
> The point though is that REPLACE is restricted to a type of predicate
> narrow enough to be enforced through a unique-index mechanism, and so
> it's implementable without solving the general case of predicate
> locking.
>
> Predicate locking for narrow cases isn't very hard; it's the general
> case of arbitrary predicates that's hard.

My feeling is we should implement MERGE for the limited cases we can,
and throw an error for cases we can not (or require table locking), and
then see what reports we get from users.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-11-16 00:22:44 Re: MERGE vs REPLACE
Previous Message Bruce Momjian 2005-11-16 00:12:25 Re: MERGE vs REPLACE