pg 关于不插入重复字段的方法

首先在表的某列加入唯一约束

alter table language_pms add CONSTRAINT language_pms_unique unique(xml); 
insert into language_pms
(SELECT "Key (关键信息)",'<sys:String x:Key="'||"Key (关键信息)"||'">'||"25_한국어 (Korean-韩语)"||'</sys:String>' from "client_3" as t
where t."Key (关键信息)"!='Key (关键信息)' and t."25_한국어 (Korean-韩语)"!='') on conflict(key)  do nothing

  

posted @ 2018-07-03 14:19  大老虎打老虎  阅读(290)  评论(0编辑  收藏  举报