Glossary: PostgreSQL Beyond the Basics
FOR UPDATE
Also written: SELECT ... FOR UPDATE
A SELECT clause that locks the rows it returns, so other writers wait for your transaction. It is used to avoid lost updates and, with SKIP LOCKED, to build work queues.