Postgres.js is a fast, full-featured PostgreSQL client for Node.js, Deno, Bun, and Cloudflare, useful for connecting to Postgres and running SQL from JavaScript. It provides an easy API based on tagged template strings, handling query parameters safely and returning results as arrays of row objects.
Project status
- The repository appears actively maintained, with a recent upstream push on 2026-04-05 and follow-on versioned updates in 2026 (v3.4.9 on 2026-04-05, v3.4.8 on 2026-01-06), plus multiple prior bugfix-focused updates across 2024-2025.
- Update cadence looks steady but not frequent, with gaps of roughly 2 to 9 months between notable updates (for example, v3.4.5 in 2024-10, v3.4.6 in 2025-05, v3.4.8 in 2026-01, and v3.4.9 in 2026-04).
AI summary generated Today
Recent updates
v3.4.9
2 months agov3.4.9 is a small point release published alongside a note that it fixes https://github.com/porsager/postgres/issues/1143. In the provided code diff, the only concrete changes are to the TypeScript declaration file (types/index.d.ts) and the package version bump.
v3.4.8
5 months agov3.4.8 adds SSL negotiation support for sslnegotiation=direct, improves typing for TransactionSql, and introduces a clearer error when executing queries during COPY. It also changes the default connection pool size for Cloudflare Workers environments.
BreakingFeaturesv3.4.7
5/21/2025v3.4.7 updates the connection logic to correctly handle reserved queries during connection setup, and adds coverage to ensure errors surface properly when using reserve. The release notes only mention reserved queries failing on connect, but the code changes also adjust general connection initialization/error behavior around the internal `initial` state.
v3.4.6
5/20/2025v3.4.6 includes targeted fixes around connection error handling, especially for sql.reserve(), and improves how errors are normalized when the driver throws non-Error values. It also adds environment-driven configuration via PGAPPNAME (application_name), and updates TypeScript typings for some Postgres error code variants.
Featuresv3.4.5
10/25/2024v3.4.5 includes targeted fixes, including adjustments for Deno 2 behavior and safer error augmentation. It also changes the Cloudflare-related export name in package.json from worker to workerd.
Breakingv3.4.4
3/21/2024v3.4.4 tightens retry behavior to only apply certain routine-based retries to prepared statements, and improves logical replication subscription handling. It also updates replication LSN tracking on Primary Keep Alive messages and adds an onerror handler hook for subscribe streams.
BreakingFeaturesv3.4.3
11/2/2023v3.4.3 is a small release focused on properly initializing reserved connections, with the release notes calling out a fix for issue #718. The code changes and added tests suggest a connection state initialization adjustment related to array/type fetching behavior on reserved connections.
v3.4.2
10/27/2023v3.4.2 focuses on connection lifecycle correctness and type improvements. It adds support for sslrootcert, fixes auth startup race conditions, preserves the original query error object, and ensures transactions fail reliably when the connection closes unexpectedly.
Featuresv3.4.1
10/23/2023Release v3.4.1 updates module export mappings to improve TypeScript 4.7 compatibility and to ensure Bun uses the ESM entry rather than the Cloudflare Worker build. It also expands the Cloudflare crypto polyfill createHash implementation to support md5 hashing and hex-encoded digests.
v3.4.0
10/10/2023v3.4.0 adds support for Cloudflare Workers and Pages, and introduces new transaction and connection management capabilities, including sql.reserve() and sql.prepare(name). The release also includes several bug fixes around streaming, subscribe behavior, runtime compatibility (Deno and Bun), and TypeScript typing improvements.
Features