### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR:
column "id" does not exist 位置:26 ### The error may exist in file
[/Users/jason/IdeaProjects/SpringBootdemo/target/classes/mapping/UserMapper.xml]
### The error may involve defaultParameterMap ### The error occurred while
setting parameters ### SQL: select * from user where id = ? ### Cause:
org.postgresql.util.PSQLException: ERROR: column "id" does not exist 位置:26 ;
bad SQL grammar []; nested exception is org.postgresql.util.PSQLException:
ERROR: column "id" does not exist 位置:26] with root cause
搜了半天都没有看到解决方案,最后发现是一个很可笑的问题。

原因是,user是postgres自带的表(我记得基本数据库都有这个表),存的是数据库的用户,所以自己建表的时候需要避免创建自带的表。(但是我看网上很多例子写的都是user,不知道是怎么成功的)
最后次改成来users立马成功了。

技术
今日推荐
PPT
阅读数 96
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:766591547
关注微信