Atomic UPSERT with unique constraint on null-able column in PostgreSQL
This post will be probably be very boring for everyone who doesn't have this problem. But since it cost me some time to figure out a solution, I think it is worth sharing.
I care. You share. Read on!
Authors have copyrights. People say these things in footers.
All Hail the Great Yawgmoth, Father of Machines.