diff --git a/plugins/dbgate-plugin-postgres/src/backend/drivers.js b/plugins/dbgate-plugin-postgres/src/backend/drivers.js index 46d11f02..4faf653a 100644 --- a/plugins/dbgate-plugin-postgres/src/backend/drivers.js +++ b/plugins/dbgate-plugin-postgres/src/backend/drivers.js @@ -147,10 +147,14 @@ const drivers = driverBases.map(driverBase => ({ query.on('error', error => { console.log('ERROR', error); - const { message, lineNumber, procName } = error; + const { message, position, procName } = error; + let line = null; + if (position) { + line = sql.substring(0, parseInt(position)).replace(/[^\n]/g, '').length; + } options.info({ message, - line: lineNumber, + line, procedure: procName, time: new Date(), severity: 'error',