https://wiki.postgresql.org/wiki/UPSERT
Anonymous
Solving the next 5% probably costs more than the previous 90%.