After all, this is a consequence of PostgreSQL’s multi-version concurrency control (MVCC). 13. insert into table_b (pk_b, b) select pk_a,a from table_a on conflict (pk_b) do update set b=excluded.b; Avoid naming a constraint directly when using ON CONFLICT DO UPDATE PostgreSQL 9.5 will have support for a feature that is popularly known as "UPSERT" - the ability to either insert or update a row according to whether an existing row with the same key exists. ... Postgresql 10 There is no unique or exclusion constraint matching the ON CONFLICT specification. But for some reason my query saying constraint doesn't exist (when it does). Please check if it is defined correctly and try using the constraint name directly:... on conflict on constraint