diff --git a/packages/pg/lib/client.js b/packages/pg/lib/client.js index 596d3dec..375bdcbd 100644 --- a/packages/pg/lib/client.js +++ b/packages/pg/lib/client.js @@ -563,10 +563,10 @@ Client.prototype.end = function (cb) { } if (cb) { - this.connection.stream.once('close', cb) + this.connection.once('end', cb) } else { return new this._Promise((resolve) => { - this.connection.stream.once('close', resolve) + this.connection.once('end', resolve) }) } }