不要怂,就是干,撸起袖子干!

Commit f5927a6a by clncln1 Committed by Felix Becker

fix(connection): pg connection initialization regression (#7986)

In case the initial query contains multiple statements in the postgres connection manager, the result will be an array which is not being handled here. Since we are only interested in the rows from the very last statement, we can skip the rest.

Closes #7985
1 parent 93a09b73
Showing with 3 additions and 1 deletions
......@@ -153,7 +153,9 @@ class ConnectionManager extends AbstractConnectionManager {
query += 'SELECT typname, oid, typarray FROM pg_type WHERE typtype = \'b\' AND typname IN (\'hstore\', \'geometry\', \'geography\')';
}
return new Promise((resolve, reject) => connection.query(query, (error, result) => error ? reject(error) : resolve(result))).then(result => {
return new Promise((resolve, reject) => connection.query(query, (error, result) => error ? reject(error) : resolve(result))).then(results => {
const result = Array.isArray(results) ? results.pop() : results;
for (const row of result.rows) {
let type;
if (row.typname === 'geometry') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!