Cause: org.postgresql.util.PSQLException: ERROR: cached plan must not change result type的前因后果
首先说明一下遇到的问题:
PG数据库,对其中的某张表增加一列后,应用报错,信息如下:
应用使用相关框架如下:SpringBoot、MyBatis。
### Cause: org.postgresql.util.PSQLException: ERROR: cached plan must not change result type
; uncategorized SQLException for SQL []; SQL state [0A000]; error code [0]; ERROR: cached plan must not change result type; nested exception is org.postgresql.util.PSQLException: ERROR: cach
ed plan must not change result type] with root cause
org.postgresql.util.PSQLException: ERROR: cached plan must not change result type
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198) ~[postgresql-9.3-1103-jdbc4.jar:?]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927) ~[postgresql-9.3-1103-jdbc4.jar:?]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) ~[postgresql-9.3-1103-jdbc4.jar:?]
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:562) ~[postgresql-9.3-1103-jdbc4.jar:?]
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:420) ~[postgresql-9.3-1103-jdbc4.jar:?]
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:413) ~[postgresql-9.3-1103-jdbc4.jar:?]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:2931) ~[druid-1.0.25.jar:1.0.25]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) ~[druid-1.0.25.jar:1.0.25]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:2929) ~[druid-1.0.25.jar:1.0.25]
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:131) ~[druid-1.0.25.jar:1.0.25]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:493) ~[druid-1.0.25.jar:1.0.25]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) ~[mybatis-3.4.0.jar:3.4.0]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77) ~[mybatis-3.4.0.jar:3.4.0]
at sun.reflect.GeneratedMethodAccessor106.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
查找原因:cached plan must not change result type是与数据库的DDL操作有关,并且在使用了prepare语句情况下会发生。
参考链接:http://blog.csdn.net/sea3389/article/details/38657345
增加表的字段确实是DDL操作,但是我的sql中并没有使用prepare语句。
继续查找原因:使用语法#{}会导致MyBatis创建预处理语句属性
参考链接:http://blog.csdn.net/huazb4815/article/details/30289297
解决办法:
重启应用
一些参考:
https://stackoverflow.com/questions/34180932/error-cached-plan-must-not-change-result-type-when-mixing-ddl-with-select-via
https://stackoverflow.com/questions/2783813/postgres-8-3-error-cached-plan-must-not-change-result-type
http://www.cnblogs.com/chenmh/articles/5308085.html
https://baike.baidu.com/item/DDL/21997?fr=aladdin
Cause: org.postgresql.util.PSQLException: ERROR: cached plan must not change result type的前因后果的更多相关文章
- Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
Springboot项目,使用postgresql数据库,mybatis做持久层框架, <select id="select" resultMap="BaseRes ...
- 【hibernate postgresql】注解@TypeDef/@Enumerated/数据库字段gender为枚举类型,从前台接受到实体后进行保存报错:org.postgresql.util.PSQLException: ERROR: column "gender" is of type gender but expression is of type character varying
数据库字段gender为枚举类型,从前台接受到实体后进行保存报错:org.postgresql.util.PSQLException: ERROR: column "gender" ...
- pg数据库org.postgresql.util.PSQLException: ERROR: "xxx" is not a sequence
问题场景 对pg数据表执行插入语句的时候,报错如下: { "timestamp": 1587012576734, "status": 500, "er ...
- Try setting a different JdbcType for this parameter or a different configuration property. Cause: org.postgresql.util.PSQLException: 栏位索引超过许可范围:2,栏位数:1
执行mybaits sql <delete id="delete4BatchesByLineCi" parameterType="java.util.List&qu ...
- Postgresql客户端不能远程连接数据库服务器 org.postgresql.util.PSQLException:
Postgresql安装完成之后,默认情况下是不允许远程客户端直接连接的,并且默认的监听配置文件里边,监听的服务器地址是127.0.0.1即:localhost 报如下错误: org.postgres ...
- org.postgresql.util.PSQLException: 栏位索引超过许可范围:3,栏位数:2。
org.postgresql.util.PSQLException: 栏位索引超过许可范围:3,栏位数:2. 今天在写完SQL进行查询的时候,后台一直报错显示上面的信息.看错误完全不知道原因,就重新检 ...
- org.postgresql.util.PSQLException:致命:抱歉,已经有太多客户了(org.postgresql.util.PSQLException: FATAL: sorry, too many clients already)
我正在尝试连接到Postgresql数据库,我收到以下错误: 错误:org.postgresql.util. PSQLException:致命:抱歉,已经有太多客户 错误是什么意思,我该如何解决? 我 ...
- Caused by: org.postgresql.util.PSQLException: 错误: 语法错误 在 "desc" 、语法错误 在 "from" 附近
此错误一般是由于postgres的数据库表字段名定义与关键字重名所致: 如下,创建的数据库表包含名称为“desc”的字段与倒叙查询的desc关键字冲突会导致Caused by: org.postgre ...
- Cause: org.postgresql.util.PSQLException: 栏位索引超过许可范围:13,栏位数:12
Cause: org.postgresql.util.PSQLException: 栏位索引超过许可范围:13,栏位数:12. 这个报错的原因是在mapper文件中的sql语书写错误 <inse ...
随机推荐
- mac常用操作:
Mac常用软件需要熟悉 常用操作: command + w 关闭窗口 + n 最小化当前窗口 + m 关闭所有窗口 + + w command + c 复制 command + v 粘贴 co ...
- JavaScript Ajax上传文件miniupload.js
用到jquery和layer.js (function ($) { $.fn.miniupload = function (options, callback) { var jqDom = $(thi ...
- poj3608 Bridge Across Islands
地址:http://poj.org/problem?id=3608 题目: Bridge Across Islands Time Limit: 1000MS Memory Limit: 65536 ...
- 20155203 2016-2017-4 《Java程序设计》第8周学习总结
20155203 2016-2017-4 <Java程序设计>第8周学习总结 教材学习内容总结 1.channel的继承架构 2.position()类似于堆栈操作中的栈顶指针. 3.Pa ...
- java提升路线
转载自:http://blog.csdn.net/a151296/article/details/43658853 作为一名即将从事java开发的应届毕业生,迷茫中,转载此篇文章,作为提升自己的学习方 ...
- Python笔记 #09# Basic plots with matplotlib
源:DataCamp 气泡的大小表示人口的多少,横坐标表示人均GDP(美元),纵坐标表示预期寿命.-- 作者:Hans Rosling Python 中有许许多多用于可视化的包,而 matplotli ...
- Linux点亮一个灯
一 文件及其驱动程序 1.解压linux 压缩包 使用命令: tar xzvf linux-3.0.8-20140925.tgz ( tar xvf ------.tar tar xzvf------ ...
- 从IC设计业看中国企业之发展
从IC设计业看中国企业之发展 在半导体领域,国际平均毛利润水平为40%.去年IC设计年会中,中国半导体行业协会IC设计分会理事长魏少军指出,中国IC设计业平均毛利润水平比国际平均水平低了12.39 ...
- POJ 1730 Perfect Pth Powers(唯一分解定理)
http://poj.org/problem?id=1730 题意:给出一个n,a=b^p,求出最大p值. 思路: 首先利用唯一分解定理,把n写成若干个素数相乘的形势.接下来对于每个指数求最大公约数, ...
- python 随机选择字符串中的一个字符
import random print(random.choice('abcdefghijklm'))