Caused by: org.postgresql.util.PSQLException: 错误: 重复键违反唯一约束"孔隙水压力测量表_pkey"
详细:键值"(gcrq, pkiaa)=(2021-04-01, 1)" 已经存在
还有同样的报错:如下:
SQL: update 观测井孔水位观测表 set sweged=?,cllx=?,swaci=?,sbbh=?,gcrq=?,swnaad=?,swefed=?,jjdac=?,lrsj=?,lrry=?,sfjy=?,jyrq=?,jyry=? where pkiaa=?
; ERROR: duplicate key value violates unique constraint “观测井孔水位观测表_pkey”
详细:Key (gcrq, pkiaa, swnaad)=(2006-07-01, 1153006003653369001, 12:50:50) already exists.; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint “观测井孔水位观测表_pkey”
详细:Key (gcrq, pkiaa, swnaad)=(2006-07-01, 1153006003653369001, 12:50:50) already exists.
解决办法:
update 光纤观测数据表 set gxjckbh=#{gxjckbh},qkcjl=#{qkcjl},gjc1ysl=#{gjc1ysl},gjc1ms=#{gjc1ms},gjc2ysl=#{gjc2ysl},gjc2ms=#{gjc2ms} where pkiaa=#{pkiaa} and jcsj=#{jcsj}
两个主键放在where 后面。