Jul 2, 2024
I'm using the shift row to have a single lock when updating any doctor on this shift. Serializable uses range/predicate locks (shift_id = 1). I can do the same with a SELECT FOR UPDATE on the parent row. It could be a SELECT FOR SHARE, but SELECT FOR UPDATE also avoids lost updates.