我正在使用 nodejs 0.10.12 和最新版本的 node-postgres 模块。我尝试使用准备好的语句,我有类似的东西
var query = client.query( {text:"insert into controller(c_name) values($1)", values:[ja]});
//ja is a var that contains user input came from the client side
query.on("error", function (error) {
console.log(error)});
query.on("end", function (result) {
console.log(result), client.end()});
我得到以下信息
{[error: permission denied for relation controller]
length: 116,
name: 'error',
severity: 'ERROR',
code: '42501',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
file: '.\\src\\backend\\catalog\\aclchk.c',
line: '3166',
routine: 'aclcheck_error'}
undefined
我承认我是 node 和那个模块的新手,所以我不知道如何解决这个问题。有什么建议/提示吗?
非常感谢