Skip to content

4.5.0

Choose a tag to compare

@okomarov okomarov released this 17 Oct 13:52
· 75 commits to main since this release

@steadybrew/postgresjs@4.5.0 lets queries with values take one round trip instead of two, and fixes wrong rows after a failed query, hangs after COPY TO and a crash when cancelling a query you don't await. No breaking changes; two behavior changes correct settings that did the opposite of what they say.

npm install @steadybrew/postgresjs@4.5.0
  • Queries with values can take one round trip instead of two, with parameter_types: 'client'. In production on one app behind the Supabase pooler, the median query went from 5.3 to 3.1 ms.
  • parameter_types: 'warn' reports the queries 'client' would send differently.
  • Node.js 22 is supported.
  • await using sql = postgres() ends the pool, and using reserved = await sql.reserve() releases the connection, when they go out of scope.
  • PGPREPARE=false, PGFETCH_TYPES=false, PGDEBUG=false and PGSSL=disable (or false) now turn those options off.
  • target_session_attrs: 'read-write' no longer connects to a hot standby, and 'read-only' now accepts one.
  • A query no longer gets empty slots at the start of its result after the previous query on the connection failed or was cancelled partway through its rows.
  • Queries no longer hang after a COPY ... TO STDOUT whose reader fell behind.
  • Cancelling a query you don't await no longer crashes the process.
  • dd-trace records Postgres.js spans again when the fork is installed as postgres.
  • Code that assigns err.stack on a query error no longer throws on Node 22 and newer.
  • TypeScript accepts the sslnegotiation and socket options.
  • new PostgresError('message') sets the message, like Error.
  • Column names ending with an underscore no longer throw under the camel and pascal transforms.
  • A cancelled query no longer stays pending forever when a schema change made the server reject it before it started.

See the changelog for details and upstream references.

Validation: CI passed on Node 22/24/26 × PostgreSQL 15–18, Deno and workerd (run). Every upstream report and pull request listed as fixed has a test that fails on Postgres.js 3.4.9 for the reported reason and passes here.