Re: ask for review of MERGE - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: ask for review of MERGE
Date
Msg-id 4CC369C8.8080104@agliodbs.com
Whole thread Raw
In response to Re: ask for review of MERGE  (Greg Stark <gsstark@mit.edu>)
Responses Re: ask for review of MERGE
List pgsql-hackers
> So the trick for MERGE on equality would be to refactor the btree api
> so that you could find the matching leaf page and *keep* that page
> locked. Then do an update against the conflicting row found there if
> any without ever releasing that page lock. Someone else can come along
> and delete the row (or have already deleted it) before the update
> locks it but if they do you can insert your row without worrying about
> anyone else inserting a conflicting entry since you're still holding a
> lock on the page they'll need to insert the btree entry on and have
> been holding it continuously for the whole operation.

I think that such a lock would also be useful for improving the FK 
deadlock issues we have.

--                                   -- Josh Berkus                                     PostgreSQL Experts Inc.
                           http://www.pgexperts.com
 


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: ask for review of MERGE
Next
From: Tom Lane
Date:
Subject: Re: WIP: extensible enums