Preventing Lost Updates on Full-Text Saves with a Line-Level 3-Way Merge
When writers save by replacing a whole document, last-write-wins causes lost updates, and an optimistic-locking conflict error pushes the merge onto every caller. This post does a line-level 3-way merge on the server, using an immutable base snapshot and SELECT … FOR UPDATE.
