Hi, On 2018-04-04 18:34:26 -0300, Alvaro Herrera wrote: > > It's also fairly weird that heap_lock_updated_tuple() returns > > /* nothing to lock */ > > return HeapTupleMayBeUpdated; > > when the tuple has been deleted (and thus > > ItemPointerEquals(&tuple->t_self, ctid)). That'll not get returned by > > heap_lock_tuple() itself, but seems thoroughly confusing. > > Yeah, what MayBeUpdated is supposed to mean in this case is "there is no > error, we were able to do the thing we were asked to do", rather than > exactly "yes, you may update the tuple". I guess you could argue that > reusing HTSU result values for it was wrong. It was certainly > convenient.
I think just adding a comment along those lines should be good enough... Greetings, Andres Freund