Atomically CLAIM a SET of rows and RETURN them: UPDATE table SET set WHERE where RETURNING *. The claim-then-act
variant of claimOnce — for a batch sweep (mark a waitlist notified / a cart-recovery emailed) where each
row must be handled exactly once even if the sweep overlaps: a concurrent run's UPDATE claims a DISJOINT set, so
the side-effect (email, notify) fires once per row. Returns the rows THIS call won; act only on those.
Atomically CLAIM a SET of rows and RETURN them:
UPDATE table SET set WHERE where RETURNING *. The claim-then-act variant of claimOnce — for a batch sweep (mark a waitlist notified / a cart-recovery emailed) where each row must be handled exactly once even if the sweep overlaps: a concurrent run's UPDATE claims a DISJOINT set, so the side-effect (email, notify) fires once per row. Returns the rows THIS call won; act only on those.