mybatis查询,Cause: org.postgresql.util.PSQLException: ERROR: column "id" does not exist

### 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立马成功了。

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值