"Florian G. Pflug" <fgp(at)phlo(dot)org> writes:
> I don't get it. EPQ would need to reevaluate the plan of the _select_
> belonging to the _cursor_, not the plan of the _update_, to prevent
> the effect outlined above. Are you suggesting to use EPQ for that?
Yes, I don't think you have much choice --- note that SELECT FOR UPDATE
doesn't block self-updates, so assuming that the row is unmodified
doesn't work.
If WHERE CURRENT OF were easy, we'd have done it before now ;-)
regards, tom lane