Skip to content

Upgrading pg 6 to 7

Breaking6.4.2 → 7.18.2Breaking7Security1Platform1Deprecated2New16Changed3Other3

BreakingUpgrade verdict

7 breaking changes and a platform requirement change and a security fix.

  • Remove pg.connect pg.end and pg.cancel singleton methods.
  • Reverts 7.13.0 as it contained an accidental breaking change for self-signed SSL cert verification.
  • Client#connect(callback) now returns undefined.
  • Upgrade pg-pool to 2.x.
Top 5 of 11 that need code or config changes

pg publishes an official migration guide for version 7. It covers more than the release notes do.

Please see here for a migration guide ↗

Node.js requirement changed in 7.0.1: >= 0.8.0 → >= 4.5.0.

Adds pg-packet-stream ^1.1.0.

Drops js-string-escape.

Installs 14 packages in all (was 16).

Breaking7
Remove pg.connect pg.end and pg.cancel singleton methods.
pg.connectpg.endpg.cancel
Reverts 7.13.0 as it contained an accidental breaking change for self-signed SSL cert verification.
Client#connect(callback) now returns undefined.
Client#connect(callback)undefined
Upgrade pg-pool to 2.x.
Upgrade pg-native to 2.x.
Standardize error message fields between JS and native driver.
Result from multi-statement text queries such as SELECT 1; SELECT 2; are now returned as an array of results instead of a single result with 1 array containing rows from both queries.
Security1
Remote Code Execution in pg
Critical · CVSS 9.8
Platform1
Drop support for node < 4.x.
Deprecated2
This version contains a few bug fixes and adds a deprecation warning for a pending change in 8.0 which will flip the default behavior over SSL from rejectUnauthorized from false to true making…
rejectUnauthorizedfalsetrue
Warn about deprecation for calling constructors without new.
new