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

你可能感兴趣的:(mybatis)