Lincoln Yeoh <lyeoh@pop.jaring.my> writes:
> Right now select for update limit 1 seems to lock all rows in the where
> clause, not just retrieved rows.
This claim surprises me quite a lot, since the FOR UPDATE locking occurs
at the outer level of the executor where rows are about to be returned.
And I can't duplicate your result in a simple test. Could you post a
reproducible example?
regards, tom lane