Packages

postgres

4.1.1 · 11 Nov 2026Unlicense38.9M / weekRepositoryHomepagenpmAtom feed

Your version

36 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 4.x · latest line
  2. 4.1.1

    11 Nov 2026
    • A statement sql.begin sends after its own COMMIT or ROLLBACK is rejected (#1320). A statement the callback did not await, sent between the transaction's COMMIT or ROLLBACK and the release of its connection, ran outside the transaction, and after a rollback its write was kept. It now rejects with UNSAFE_TRANSACTION, as a statement after the transaction has ended does.

    • A command after a select in a multi-statement simple query has no columns (#1321). In sql.unsafe('select …; rollback') the ROLLBACK result had the columns of the SELECT before it.

    • A query queued behind one with an untyped string or boolean parameter resolves on Cloudflare Hyperdrive (#1319). Such a query is described first, and 4.1.0 sent its Bind, Execute and Sync together with the next query, which never resolved through Hyperdrive. On Cloudflare Workers the next query now waits until the described one is done, as in 3.4.9. Other runtimes still pipeline it.

  3. 4.1.0

    5 Nov 2026

    Summary· from the note as AI read it

    Upgrade: this release fixes a security issue.

  4. 4.0.0

    29 Oct 2026

    Summary· from the note as AI read it

    Upgrade: this release fixes a security issue.

    • Security

      A NUL character in a connection parameter can no longer add parameters (also in v3). A database, user or connection value such as 'db\0user\0postgres' was sent as further startup parameters, so an app that put untrusted input there, as with a database per tenant, could be made to log in as another user where that user needs no password, or with replication or options set. A NUL in any protocol string, also in query text and identifiers, now rejects with NUL_CHARACTER.

    • Security

      A column named __proto__ is an own property (also in v3). It became the prototype of the row, so a JSON value in it, for instance from a column alias built from user input, made the row inherit its properties (row.isAdmin), in query results and in sql.subscribe rows alike.

  5. 3.x
  6. 3.4.9

    5 Apr 2026
  7. 3.4.8

    6 Jan 2026
    • Prevent out of bound errors from commit-time failures de64f7a

    • Use lower max connections in Cloudflare Workers environment 94b7170

    • Add support for sslnegotiation=direct - fixes #1104 7f80980

  8. 3.4.7

    21 May 2025
    • Fix reserved queries failing on connect e34826d

  9. 3.4.6

    20 May 2025
    • Fix failures in sql.reserve() connect shadowing real errors e8bb3b8

    • Fix stuck queries on non busy connections 76c13f2

    • Ensure non object errors thrown are handled properly a39dfef

  10. 3.4.5

    25 Oct 2024
    • Removed

      Remove "worker" export as we now have "workerd" for cloudflare cc688c6

    • Fix for deno 2 5fb70c1

    • Don't reassign to errors 4baef5e, f58cd4f

  11. 3.4.4

    21 Mar 2024
    • Ensure retryRoutines are only used for prepared statements - fixes #830 3e28f3a

    • Update lsn on Primary Keep Alive Message a5cd811

    • Add subscribe onerror handler 3e3d5e8

  12. 3.4.3

    2 Nov 2023
    • Ensure reserved connections are initialized properly - fixes #718 c084a1c

  13. 3.4.2

    27 Oct 2023
    • Ensure transactions throw if connection is closed while there is no active query - fixes #658 788c819

    • Fix race conditions in auth startup - fixes #430 #668 33ae0ed

    • Adding support for sslrootcert option in connection string (#690) 0bee4c3

  14. 3.4.1

    23 Oct 2023
    • Set "types" exports first as ts 4.7 requirement (#709) 00dd98a

    • Ensure bun imports esm instead of cf worker - fixes #692 c1d8519

    • Update Cloudflare createHash polyfill to support md5 and hex encoding 09e6cb5

  15. 3.4.0

    10 Oct 2023
    • Add Support for Cloudflare Workers & Pages (#599) b88e261

    • Add sql.reserve method 7f6e0cc

    • Add sql.prepare(name) to allow custom names (#628) 8f6f4e3

  16. 3.3.5

    31 May 2023
    • Use ; as a delimiter for _box 26d08c8

    • Don't override array type if already exists 62a23bb

    • Document sql.unsafe query fragments (#567) c9ded40

  17. 3.3.4

    7 Mar 2023
    • Set servername on tls connect - fixes #543 498f2ae

    • Unlisten channel names with period (#550) df0343d

    • Fallback to escaping multiple identifiers if no builder found - fixes #532 58aac20

  18. 3.3.3

    3 Jan 2023
    • Fix connection uri encoding (#497) 4467d11

    • Fix logic reversal for target_session_attrs=primary|standby 4aa19d1

    • Fix transform function logic for deeply nested jsonb (#530) a848ca6

  19. 3.3.2

    16 Nov 2022
    • Fix null json array transform error b153202

    • Fix nested json array transform - fixes #506 5dea953

    • Allow period in listen channel names - fix #495 a12108a

  20. 3.3.1

    3 Oct 2022
  21. 3.3.0

    30 Sep 2022
    • Fix subscribe stream close 19c9684

    • Support transform in subscribe messages 4e28de9

    • Prevent transform of columns when using subscribe - fixes #474 4ea4a59

  22. 3.2.4

    25 May 2022
    • Allow setting keep_alive: false bee62f3

    • Fix support for null in arrays - fixes #371 b04c853

  23. 3.2.3

    23 May 2022
    • Fix Only use setKeepAlive in Deno if available 28fbbaf

    • Fix wrong helper match on multiple occurances 02f3854

    • Fix Deno assertRejects compatibility (#365) 0f0af92

  24. 3.2.2

    15 May 2022
    • Properly handle errors thrown on commit 99ddae4

  25. 3.2.1

    15 May 2022
    • Exclude target_session_attrs from connection obj 43f1442

  26. 3.2.0

    15 May 2022
    • Add sslmode=verify-full support e67da29

    • Add support for array of fragments 342bf55

    • Add uri decode of host in url - fixes #346 1adc113

  27. 3.1.0

    22 Apr 2022
    • Add close method to close but not end connections forever 94fea8f

    • Add .values() method to return rows as arrays of values 56873c2

    • Support transform.undefined - fixes #314 eab71e5

  28. 3.0.6

    19 Apr 2022
    • Properly close connections in Deno 13950af

    • Only write end message if open 408a2fb

    • Improve query cancellation d69e264

  29. 3.0.5

    6 Apr 2022
    • Fix transaction execution timing 28bb0b3

    • Add optional onlisten function to listen 1dc2fd2

    • Fix dynamic in helper after insert #305 4d63a59

  30. 3.0.4

    5 Apr 2022
    • Ensure drain only dequeues if ready - fixes #303 3f9118b

  31. 3.0.3

    4 Apr 2022
  32. 3.0.2

    31 Mar 2022
  33. 3.0.1

    30 Mar 2022
    • Improve connection queue handling + fix leak cee1a57

    • Use publications option - fixes #295 b5ceecc

    • Add types to debug signature dbb668c

  34. 3.0.0

    24 Mar 2022
    • Breaking

      Cursors are always called with Result arrays (previously cursor 1 would return a row object, where > 1 would return an array of rows)

    • Breaking

      .writable() and .readable() is now async (returns a Promise that resolves to the stream)

    • Breaking

      Queries now returns a lazy promise instead of being executed immediately. This means the query won't be sent until awaited (.then, .catch, .finally is called) or until .execute() is manually called.

  35. 1.x
  36. 1.0.2

    21 Jan 2020
    • Fix standard postgres user env var (#20) cce5ad7

    • Ensure url or options is not falsy bc549b0

    • Add support for dynamic password b2ab9fb

  37. 1.0.1

    3 Jan 2020
    • Fix #3 url without db and trailing slash 45d4233

    • Fix stream promise - resolve with correct result 730df2c

    • Fix return value of unsafe query with multiple statements 748f198

  38. 1.0.0

    22 Dec 2019
    • Initial release

  39. 0.0.x
  40. 0.0.1

    1 Jan 2015

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.