handling pg_typeof undefined

This commit is contained in:
Simon Martín
2018-05-10 18:36:08 +02:00
parent 99516f5a75
commit eba68c56ef
+5
View File
@@ -52,6 +52,11 @@ module.exports = class BaseDataview {
if (err) {
return callback(err);
}
if (!result || !result.rows || !result.rows.length) {
return callback(new Error('The column type could not be determined'));
}
const pgType = result.rows[0].pg_typeof;
callback(null, getPGTypeName(pgType));
}, readOnlyTransaction);