grails postgres消息:错误:列this_.id不存在

sur*_*oud 3 postgresql grails

与用户域postgres的grails.

 Message: ERROR: column this_.id does not exist
Run Code Online (Sandbox Code Playgroud)

sur*_*oud 6

得到了这个问题.对于用户域,我将postgres表作为"user".因此,默认情况下,当它尝试查询用户表时,它不会查询"user.id".postgres对"user"表有问题.

所以我将"用户"表更新为"myapp_user"表.问题解决了.


小智 5

'user' 一词可能被 dbms 保留。

static mapping = {
    table '`User`'
    password column: '`password`'
}
Run Code Online (Sandbox Code Playgroud)