Postgresql BatchInsert唯一键冲突及解决
当有唯一键冲突时,批量插入可能会报错;
insert into tableA(sno,name,age,emp) values(),(),();
会报错
insert into tableA(sno,name,age,emp) values(),(),() on conflict on contraint tableA_unique_key do nothing;
或者
insert into tableA(sno,name,age,emp) values(),(),() on conflict (sno,name) do nothing;