插入数据postgre 报错如下
01 |
### Error updating database. Cause: org.postgresql.util.PsqlException: ERROR: duplicate key value violates unique constraint "vehicle__appKey_pkey" |
02 |
### The error may involve com.sq.platform.basePlatform.dao.VehicleMapper.insertVehicleAppkey-Inline |
03 |
### The error occurred while setting parameters |
04 |
### sql: insert into vehicle__appkey(vehicle_id_fk,appkey_id_fk) values (?,?) |
05 |
### Cause: org.postgresql.util.PsqlException: ERROR: duplicate key value violates unique constraint "vehicle__appKey_pkey" |
06 |
; sql []; ERROR: duplicate key value violates unique constraint "vehicle__appKey_pkey" ; nested exception is org.postgresql.util.PsqlException: ERROR: duplicate key value violates unique constraint "vehicle__appKey_pkey" |
07 |
at org.springframework.jdbc.support.sqlErrorCodesqlExceptionTranslator.doTranslate(sqlErrorCodesqlExceptionTranslator.java: 239 ) |
08 |
at org.springframework.jdbc.support.AbstractFallbacksqlExceptionTranslator.translate(AbstractFallbacksqlExceptionTranslator.java: 73 ) |
09 |
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java: 74 ) |
10 |
at org.mybatis.spring.sqlSessionTemplate$sqlSessionInterceptor.invoke(sqlSessionTemplate.java: 399 ) |
11 |
at com.sun.proxy.$Proxy11.insert(Unknown Source) |
表中 vehicle__appkey id字段如下
1 |
id integer NOT NULL DEFAULT nextval('"vehicle__appKey_id_seq"'::regclass), |
@H_
404_258@