Case: The node "node-red-contrib-postgresql" when deployed in flow works smooth. But when the postgres service is stopped for any reasons. The node causes the whole nodered to crash, resulting in this error :
error: terminating connection due to administrator command\n at Parser.parseErrorMessage
Error Scenario: This error occurs when the connection pool inside the postgres node isn't written to handle error.
Fix: Open postgresql.js from the node-red-contrib-postgresql folder from node_modules and copy paste the below code to handle the connection pool error.
this.pgPool.on('error', (err, client) => {
console.log('postgres connection error : ' + err)
});
For additional details about this problem visit this link and this.