问题
SpringBoot:在postgresql数据库提交数据时,出现ERROR: column "***" is of type numeric but expression is of type character varying.You will need to rewrite or cast the expression.的错误提示。
原因是某个字段在JAVA代码中提交的是字符串类型,但pg数据库里面该字段是int类型,导致要求转换数据类型的异常提示。
解决
在数据库连接配置中加上?stringtype=unspecified,如
配置完成后,重新intall并重启服务,再次提交正常了,问题解决。