Re: Reducing some DDL Locks to ShareLock - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Reducing some DDL Locks to ShareLock
Date
Msg-id 1226275881.27904.281.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: Reducing some DDL Locks to ShareLock  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Reducing some DDL Locks to ShareLock
List pgsql-hackers
On Sun, 2008-11-09 at 17:12 -0500, Tom Lane wrote:

> Reviewing away ...

Thanks for reviewing.

> There's a fairly serious problem...

...

> Any thoughts about the best way to do it?  My immediate inclination is
> to use heap_lock_tuple but it's a bit expensive.

Not sure how non-transactional tuple locking would/could work.

The user space solution to this problem is optimistic locking. i.e.
re-read the row immediately prior to the update. If row has changed,
keep re-reading it until it stays same, then update. Rely on block
locking to protect us. I'm tired and handwaving a lot.

Will think some more and report back.

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support



pgsql-hackers by date:

Previous
From: "Vladimir Sitnikov"
Date:
Subject: Re: Windowing Function Patch Review -> ROW_NUMBER without ORDER BY
Next
From: Decibel!
Date:
Subject: Re: [WIP] In-place upgrade