null value in column "id" violates not-null constraintDetail: Failing row contains (11110, 1, null)

本文详细解析了nullvalueincolumn“id”violatesnot-nullconstraint错误的原因,通常由插入语句中的主键Id为空引起,并提供了检查和修复的方法。

null value in column “id” violates not-null constraintDetail: Failing row contains (11110, 1, null)
这个错误很简单,一般来说,是因为插入的主键Id为空引起的,检查一下 插入语句就好了

"code": "500", "msg": "\r\n### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: null value in column \"knowledge_base_name\" violates not-null constraint\n 详细:Failing row contains (181777392296001719, null, 118142606008909930, 能胜, 2025-05-13 09:56:29.004, 118142606008909930, 能胜, 2025-05-13 09:56:29.004, 0, 1).\r\n### The error may exist in com/iflytek/fpva/cdc/mapper/common/TbCdcewKnowledgeBaseMapper.java (best guess)\r\n### The error may involve com.iflytek.fpva.cdc.mapper.common.TbCdcewKnowledgeBaseMapper.insert-Inline\r\n### The error occurred while setting parameters\r\n### SQL: INSERT INTO tb_cdcew_knowledge_base ( id, modify_user, create_user_id, modify_time, deleted, create_time, modify_user_id, create_user, mark ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ? )\r\n### Cause: org.postgresql.util.PSQLException: ERROR: null value in column \"knowledge_base_name\" violates not-null constraint\n 详细:Failing row contains (181777392296001719, null, 118142606008909930, 能胜, 2025-05-13 09:56:29.004, 118142606008909930, 能胜, 2025-05-13 09:56:29.004, 0, 1).\n; ERROR: null value in column \"knowledge_base_name\" violates not-null constraint\n 详细:Failing row contains (181777392296001719, null, 118142606008909930, 能胜, 2025-05-13 09:56:29.004, 118142606008909930, 能胜, 2025-05-13 09:56:29.004, 0, 1).; nested exception is org.postgresql.util.PSQLException: ERROR: null value in column \"knowledge_base_name\" violates not-null constraint\n 详细:Failing row contains (181777392296001719, null, 118142606008909930, 能胜, 2025-05-13 09:56:29.004, 118142606008909930, 能胜, 2025-05-13 09:56:29.004, 0, 1).",
05-14
ERROR: null value in column "purchasing_item_flag" violates not-null constraint 详细:Failing row contains (601609119, 189, 英文FE/STM-1 Optical Transmission Materials, AT20250215153632, null, null, null, 英文FE/STM-1 Optical Transmission Materials, null, N, Y, N, N, N, N, N, Y, Y, N, N, N, N, Y, N, N, N, N, N, N, N, N, N, N, N, N, N, N, Active, 1, N, Y, 4, 2025-09-12 12:03:52, 174022309561388, 2025-02-15 15:36:42, -1, N, 73BC2092597B4A5089CB14B9E8D5E112, 2025-09-12 12:17:41.776326, 601609119, 189). Call getNextException to see other errors in the batch. at org.postgresql.jdbc.BatchResultHandler.handleCompletion(BatchResultHandler.java:186) ~[postgresql-42.7.2.jar:42.7.2] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:590) ~[postgresql-42.7.2.jar:42.7.2] at org.postgresql.jdbc.PgStatement.internalExecuteBatch(PgStatement.java:912) ~[postgresql-42.7.2.jar:42.7.2] at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:936) ~[postgresql-42.7.2.jar:42.7.2] at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1733) ~[postgresql-42.7.2.jar:42.7.2] at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:230) ~[commons-dbcp2-2.12.0.jar:2.12.0] at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:230) ~[commons-dbcp2-2.12.0.jar:2.12.0] at sun.reflect.GeneratedMethodAccessor322.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_332] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_332] at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:78) ~[mybatis-3.5.13.jar:3.5.13] at com.sun.proxy.$Proxy737.executeBatch(Unknown Source) ~[?:?] at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:126) ~[mybatis-3.5.13.jar:3.5.13] at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:129) ~[mybatis-3.5.13.jar:3.5.13] at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:122) ~[mybatis-3.5.13.jar:3.5.13] at org.apache.ibatis.executor.CachingExecutor.flushStatements(CachingExecutor.java:115) ~[mybatis-3.5.13.jar:3.5.13] at sun.reflect.GeneratedMethodAccessor316.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_332] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_332] at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.13.jar:3.5.13] at com.sun.proxy.$Proxy733.flushStatements(Unknown Source) ~[?:?] at sun.reflect.GeneratedMethodAccessor316.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_332] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_332] at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.13.jar:3.5.13] at com.sun.proxy.$Proxy733.flushStatements(Unknown Source) ~[?:?] at sun.reflect.GeneratedMethodAccessor316.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_332] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_332] at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.13.jar:3.5.13] at com.sun.proxy.$Proxy733.flushStatements(Unknown Source) ~[?:?] at sun.reflect.GeneratedMethodAccessor316.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_332] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_332] at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.13.jar:3.5.13] at com.sun.proxy.$Proxy733.flushStatements(Unknown Source) ~[?:?] at sun.reflect.GeneratedMethodAccessor316.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_332] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_332] at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.13.jar:3.5.13] at com.sun.proxy.$Proxy733.flushStatements(Unknown Source) ~[?:?] at org.apache.ibatis.session*****#*#*****Session*****#*#*****aultSqlSession*****#*#*****-3.5.13.jar:3.5.13] ... 11 more Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "purchasing_item_flag" violates not-null constraint 详细:Failing row contains (601609119, 189, 英文FE/STM-1 Optical Transmission Materials, AT20250215153632, null, null, null, 英文FE/STM-1 Optical Transmission Materials, null, N, Y, N, N, N, N, N, Y, Y, N, N, N, N, Y, N, N, N, N, N, N, N, N, N, N, N, N, N, N, Active, 1, N, Y, 4, 2025-09-12 12:03:52, 174022309561388, 2025-02-15 15:36:42, -1, N, 73BC2092597B4A5089CB14B9E8D5E112, 2025-09-12 12:17:41.776326, 601609119, 189). at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2725) ~[postgresql-42.7.2.jar:42.7.2] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2412) ~[postgresql-42.7.2.jar:42.7.2] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:579) ~[postgresql-42.7.2.jar:42.7.2] at org.postgresql.jdbc.PgStatement.internalExecuteBatch(PgStatement.java:912) ~[postgresql-42.7.2.jar:42.7.2] at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:936) ~[postgresql-42.7.2.jar:42.7.2] at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1733) ~[postgresql-42.7.2.jar:42.7.2] at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:230) ~[commons-dbcp2-2.12.0.jar:2.12.0] at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:230) ~[commons-dbcp2-2.12.0.jar:2.12.0] at sun.reflect.GeneratedMethodAccessor322.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_332] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_332] at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:78) ~[mybatis-3.5.13.jar:3.5.13] at com.sun.proxy.$Proxy737.executeBatch(Unknown Source) ~[?:?] at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:126) ~[mybatis-3.5.13.jar:3.5.13] at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:129) ~[mybatis-3.5.13.jar:3.5.13] at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:122) ~[mybatis-3.5.13.jar:3.5.13] at org.apache.ibatis.executor.CachingExecutor.flushStatements(CachingExecutor.java:115) ~[mybatis-3.5.13.jar:3.5.13] at sun.reflect.GeneratedMethodAccessor316.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_332] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_332] at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.13.jar:3.5.13] at com.sun.proxy.$Proxy733.flushStatements(Unknown Source) ~[?:?] at sun.reflect.GeneratedMethodAccessor316.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_332] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_332] at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.13.jar:3.5.13] at com.sun.proxy.$Proxy733.flushStatements(Unknown Source) ~[?:?] at sun.reflect.GeneratedMethodAccessor316.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_332] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_332] at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.13.jar:3.5.13] at com.sun.proxy.$Proxy733.flushStatements(Unknown Source) ~[?:?] at sun.reflect.GeneratedMethodAccessor316.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_332] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_332] at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.13.jar:3.5.13] at com.sun.proxy.$Proxy733.flushStatements(Unknown Source) ~[?:?] at sun.reflect.GeneratedMethodAccessor316.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_332] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_332] at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.13.jar:3.5.13] at com.sun.proxy.$Proxy733.flushStatements(Unknown Source) ~[?:?] at org.apache.ibatis.session*****#*#*****Session*****#*#*****aultSqlSession*****#*#*****-3.5.13.jar:3.5.13] ... 11 more
最新发布
09-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值