Insert If Missing, Update If Present
PostgreSQL writes an UPSERT as INSERT ... ON CONFLICT. If the chosen key does not exist, it inserts; if it exists, DO UPDATE or DO NOTHING handles the conflict.
GOAL
Predict the action taken by ON CONFLICT.
Which PostgreSQL clause updates on conflict?