unrecognized configuration parameter “autocommit” in PostgreSQL NodeJS

天涯浪子 提交于 2019-12-11 03:34:10

问题


{"message":"Err on translation create, for key blah blah blah ","name":"SequelizeDatabaseError","stack":"SequelizeDatabaseError: unrecognized configuration parameter \"autocommit\"\n at Query.module.exports.Query.formatError (/var/www/courses/courses.com.mm/dist/node_modules/sequelize/lib/dialects/postgres/query.js:361:16)\n at Query. (/var/www/courses/courses.com.mm/dist/node_modules/sequelize/lib/dialects/postgres/query.js:79:21)\n at emitOne (events.js:96:13)\n at Query.emit (events.js:188:7)\n
at Query.handleError (/var/www/courses/courses.com.mm/dist/node_modules/pg/lib/query.js:108:8)\n at Connection. (/var/www/courses/courses.com.mm/dist/node_modules/pg/lib/client.js:171:26)\n at emitOne (events.js:96:13)\n at Connection.emit (events.js:188:7)\n at Socket. (/var/www/courses/courses.com.mm/dist/node_modules/pg/lib/connection.js:109:12)\n at emitOne (events.js:96:13)\n at Socket.emit (events.js:188:7)\n
at readableAddChunk (_stream_readable.js:176:18)\n at Socket.Readable.push (_stream_readable.js:134:10)\n at TCP.onread (net.js:543:20)","parent":{"name":"error","length":102,"severity":"ERROR","code":"42704","file":"guc.c","line":"5692","routine":"set_config_option","sql":"SET autocommit = 1;"},"original":{"name":"error","length":102,"severity":"ERROR","code":"42704","file":"guc.c","line":"5692","routine":"set_config_option","sql":"SET autocommit = 1;"},"sql":"SET autocommit = 1;","isOperational":true,"level":"info","timestamp":"2016-11-09T16:56:44.885Z"}

I've encountered above error when I checked log file by terminal. I'm not sure it's postgresql error or something else. Please help me how to solve it. And here is my postgresql version:

PostgreSQL 9.5.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16), 64-bit (1 row)


回答1:


The configuration parameter autocommit has been disabled since version 7.4, released in 2003.

Up to PostgreSQL version 9.4 the parameter was still present, but had no effect.

From PostgreSQL 9.5 on (released in January 2016), the parameter has been removed, and trying to set it will cause an error message.

Try to update your client software to a more recent version.



来源:https://stackoverflow.com/questions/40517942/unrecognized-configuration-parameter-autocommit-in-postgresql-nodejs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!