A very frequently asked question here is how to do an upsert, which is what MySQL calls INSERT ... ON DUPLICATE UPDATE
and the standard supports as part of the
Here are some examples for insert ... on conflict ...
(pg 9.5+) :
insert into dummy(id, name, size) values(1, 'new_name', 3)
on conflict do nothing;`
insert into dummy(id, name, size) values(1, 'new_name', 3)
on conflict(id)
do update set name = 'new_name', size = 3;
insert into dummy(id, name, size) values(1, 'new_name', 3)
on conflict on constraint dummy_pkey
do update set name = 'new_name', size = 4;