Login
You're viewing the techdon.dev public feed.
  • Jul 15, 2026, 3:46 AM

    I've got a read-then-update pattern where I also want to queue a job (using a postgres backed job queue) the first time the record is updated. I carefully read the postgres docs and was still scratching my head about it so I put together a little test jig and raced it across two separate irb sessions. The default transaction isolation level (read committed) is not suitable, I think I want at least repeatable read.

    In MySQL (where I have the most battle hardened experience) I would use SELECT FOR UPDATE as there's no MVCC there. Postgres also supports row locking but it's not clear if I actually need it when setting the correct isolation level and retrying on serialization failure, still I feel myself pulled in that direction anyway

    💬 0🔄 1⭐ 2