Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid - Mailing list pgsql-hackers

From David Fetter
Subject Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid
Date
Msg-id 20110104162708.GA24017@fetter.org
Whole thread Raw
In response to Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid  (Greg Smith <greg@2ndquadrant.com>)
Responses Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid
Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid
List pgsql-hackers
On Tue, Jan 04, 2011 at 04:44:32AM -0500, Greg Smith wrote:
> Heikki Linnakangas wrote:
> >You can of course LOCK TABLE as a work-around, if that's what you want.
> 
> Presuming the code quality issues and other little quirks I've
> documented (and new ones yet to be discovered) can get resolved
> here, and that's a sizeable open question, I could see shipping this
> with the automatic heavy LOCK TABLE in there.  Then simple UPSERT
> could work out of the box via a straightforward MERGE.

How about implementing an UPSERT command as "take the lock, do the
merge?"  That way, we'd have both the simplicity for the simpler cases
and a way to relax consistency guarantees for those who would like to
do so.

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: regclass without error?
Next
From: Tom Lane
Date:
Subject: Re: WIP: Range Types