Build a task queue with SQL
SKIP LOCKED is an optional portion of the SELECT clause in an SQL statement. It makes it possible to build a queryable task queue in newer RDBMs. It works exactly as the name implies. When selecting with SKIP LOCKED the selected rows are locked, and any rows that may already be locked are skipped.