pg_advisory_lock(42) and pg_try_advisory_lock(42) lock a key you choose, not a row or table. Everyone who uses the same key must cooperate. It is handy for “only one instance runs this job”.