Repository navigation
Closed
Description
Planned work is on the Roadmap project and in ROADMAP.md, one fork issue per item. This list holds the rest: upstream porsager/postgres reports that @steadybrew/postgresjs does not fix yet and that have no plan yet, grouped by the kind of work a fix needs. Entries with a fork issue link to it. Checked on 2026-10-15 against the current code; items marked unverified have no reproduction yet. Reports the fork already fixes are credited in the changelog and not listed here.
Protocol and result handling bugs
- Pipelined query resolves with a sparse result array when the previous query errors mid-stream (
rowscounter not reset on ErrorResponse) porsager/postgres#1181, invalid query results: rows count not cleared after partially streamed query fails on the same connection porsager/postgres#1119, Intermittent undefined values in query results porsager/postgres#795: result arrays get empty slots after a query fails mid-stream, becauseReadyForQuerynever resetsrowsafter an ErrorResponse. Most-reported data bug. - Failed COPY FROM STDIN never settles the writable, skips ROLLBACK in sql.begin(), and permanently leaks the connection as 'idle in transaction (aborted)' porsager/postgres#1173: a
COPY FROM STDINthe server rejects never settles the writable; insidebegin()this leaks the connection (finalis only called on CommandComplete or session end). -
.cursor()async iterator swallows error when promise rejects between resolution of batchnand requesting batchn+1porsager/postgres#1166: a cursor stops silently when the server sends FATAL between batches (cursor()insrc/query.js). - Strange sql errors when lot of queries in concurrency porsager/postgres#1039: offset and null-
columnserrors under load; looks like replies matched to the wrong query. Unverified. - Deferred constraint errors not properly detected porsager/postgres#1117: a deferred-constraint error is not raised. Unverified; needs a real PostgreSQL reproduction.
Transactions and leases
- Cursor in transaction deadlock porsager/postgres#1054 (also Async iterator cursor() using queries leak connection porsager/postgres#389): a cursor inside
begin()deadlocks, because the connection is filedfullwhile the cursor waits on later statements. - Concurrent calls to notify in transaction results in deadlock, but pg_notify works porsager/postgres#966:
tx.notify()deadlocks, becausenotify()uses the outer poolsql. - Caught errors within transactions still thrown as uncaught porsager/postgres#455: an error caught inside a transaction still rejects
begin(). Deliberate today; changing it is a behaviour change.
Timeouts and bounds
- Indefinitely waiting queries porsager/postgres#1089 (also The error leaks out from try/catch porsager/postgres#513, Query timeout porsager/postgres#394): no client-side query timeout, so a query on a silently dead socket waits until TCP gives up. Proposal: Add a query timeout for silently dead sockets #9.
- Connect-Timeout Behavior - Include Waiting for Connection Pool porsager/postgres#824, Handle PostgresError: remaining connection slots are reserved for non-replication superuser connections at ErrorResponse porsager/postgres#1036: no timeout while waiting for a pool connection; would also turn the BUG: All further queries hang if transaction scoped sql parameter is not used in some queries [with reproduction code] porsager/postgres#893 self-deadlock (outer
sqlused insidebegin()with every connection held) into an error. Related: Abort reserve() and begin() leases with an AbortSignal #10. - Never-ending CONNECTION_CLOSED errors porsager/postgres#921: periodic
CONNECTION_CLOSEDafter a quiet period; hand-out expiry only helps whenidle_timeoutis set, and it defaults to off. - vitest useFakeTimers causes the postgres connection to hang porsager/postgres#1091: fake timers in tests hang queries, because writes are deferred with
setImmediate. Low severity.
Pooling and poolers
- Deadlocked/hung pool when connected to Postgres through Supavisor porsager/postgres#970 (also Queries get stuck when running static queries in concurrent cron jobs porsager/postgres#1033, arbitrary stuck queries porsager/postgres#827): Supavisor in transaction mode hangs or swaps results when queries are pipelined onto busy connections;
max_pipeline: 0works around it. Needs a fix or documented guidance (Document serverless and pooler configuration #12). - [Cloudflare Hyperdrive] PostgresError: prepared statement "o0gtsdfu434" already exists porsager/postgres#960: Hyperdrive reports "prepared statement already exists". Unverified.
listen and subscribe
- CONNECTION_CLOSED on subscribe() porsager/postgres#757 (also reconnect on disconnection from DB with subscriptions porsager/postgres#980):
subscribe()never recovers after an outage; each failed reconnect is an unhandled rejection andonerrorhandlers are not re-attached. - Calling original unlisten after reconnect leaves its callback registered porsager/postgres#1243:
unlisten()after a reconnect does not remove the callback. - The connection reserved for LISTEN is not closed after the last subscribed-to channel is unsubscribed from porsager/postgres#1022: the listen connection stays open after the last
unlisten(), andclose()does not end it.
Runtimes
- Cloudflare polyfill: unhandled rejection when a connection closes (read() emits 'error' after listeners are removed) porsager/postgres#1196, Cloudflare/workerd: every sql.end() leaves an unhandled rejection (Stream was cancelled) porsager/postgres#1202: Cloudflare workerd reports an unhandled "Stream was cancelled" on every socket close. See Cloudflare Workers: closing a connection reports an unhandled rejection on compatibility dates before 2026-03-03 #1.
- subscribe error on cloudflare: 'socket.resume is not a function' porsager/postgres#975: Cloudflare socket polyfill has no
pause/resume, sosubscribe()andCOPY TOfail on Workers. - Cloudflare build: a failed TLS handshake (untrusted CA, e.g. Supabase) surfaces as CONNECT_TIMEOUT instead of the real error porsager/postgres#1213: a TLS failure on Cloudflare surfaces as
CONNECT_TIMEOUT. Unverified. - Fails with
Error: The script will never generate a response.on cloudflare pages porsager/postgres#1013 (also Cloudflare: I/O Error porsager/postgres#884, Possible issue with cloudflare workers caused by a canceled promise porsager/postgres#865): one pool shared across Cloudflare requests. Design limit; see Research serverless platform behaviour for connection handling #8. - Issue connecting in Deno via SSL porsager/postgres#1083, CONNECT_TIMEOUT with npm module on Deno porsager/postgres#723: Deno TLS and
CONNECT_TIMEOUTreports. Unverified.
Performance and resources
- A weird issue: speed dropped porsager/postgres#747: throughput degrades over time;
Queue.remove()usesindexOfplusspliceandshift()leaves holes, so theopenqueue grows by one slot per query. - Transactions always re-query all types leading to huge delay porsager/postgres#903, Transactions repeatedly query all types, causing significant delays. porsager/postgres#952: array types are fetched again for every new connection. Research notes are in
docs/type-discovery.mdon thedocs/roadmapbranch. - PostgresJS Prevents Natural Process Exit porsager/postgres#869, Handy helper in node-postgres: allowExitOnIdle porsager/postgres#918: idle connections keep the Node process alive (no
unref).
Configuration parsing
- Bracketed IPv6 host in a connection string resolves to "[" and cannot connect porsager/postgres#1232: a bracketed IPv6 host resolves to
[, becauseparseOptionssplits on:. - Setting max: undefined results in only 1 connection being created porsager/postgres#833:
max: undefinedgives a pool of one connection.
Features
- ReservedSql appears to have methods it does not have porsager/postgres#713:
begin()on a reserved connection. - allow to rollback a transaction gracefully porsager/postgres#500: an explicit
rollback(). - Configure a minimum connection pool size porsager/postgres#672: minimum pool size.
- Feature request: dynamic username support for credential rotation porsager/postgres#881: rotating credentials.
Found here, not reported upstream
- COPY is recognised by the word
copyanywhere in a simple query's text, so a comment or literal holds back pipelining. See Narrow the COPY text match to statement starts #27. - A
backoffthat returnsundefinedreconnects in a hot loop. See A backoff that returns undefined reconnects in a hot loop #31. -
sql.savepoint()names containing a dot fail with a syntax error. See sql.savepoint() names containing a dot fail with a syntax error #35. -
sql.subscribe()never recovers whenSTART_REPLICATIONfails on an open connection. See sql.subscribe() never recovers when START_REPLICATION fails on an open connection #39. - A failed
.simple()query with untyped values may resolve the next pipelined query with an empty result. Unverified. See A failed .simple() query with untyped values may resolve the next pipelined query with an empty result #44. - A plain JS array of booleans, Dates, bigints or Buffers binds as a single value. Unverified. See A plain JS array of booleans, Dates, bigints or Buffers binds as a single value #45.
- Cancelling a pipelined query that hasn't started can give the next query its result (reported upstream too). Unverified. See [FIXED in 4.1.0] Cancelling a pipelined query that hasn't started can give the next query its result #48.
-
PGPREPARE=false,PGFETCH_TYPES=falseandPGDEBUG=falseturn those options on. See PGPREPARE=false, PGFETCH_TYPES=false and PGDEBUG=false turn those options on #49. - A CancelRequest always dials the first configured host and port (
src/transport.js), which is wrong after a multi-host failover moved the session. -
onopenshares queued queries asceil(queries / (connecting + 1))while the handed-off connection is still counted inconnecting. - A function-valued
idle_timeoutormax_lifetimeis evaluated once per connection, not per session.
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Upstream reports still open after the 4.1.0 lifecycle rework[/-][+]Upstream reports not yet fixed in the fork[/+]okomarov commentedon Oct 9, 2026
The Cloudflare entries here (porsager#975, porsager#1196, porsager#1202, porsager#1203, porsager#1213) are part of the deployed-worker test plan in #15. The Deno npm-package reports (porsager#723, porsager#1044, porsager#1083) are covered by #17.
okomarov commentedon Oct 9, 2026
porsager#1082 / porsager#729 (listed under "Protocol and result handling bugs") is a wrong-results bug, not only a hang: after the failed query is left in the pipeline, a later query receives another query's response.
Reproduced against PostgreSQL 17 during the
sql.stats()review. It ran onfeat/pool-stats, butsubmit()is identical onmain.arejects withMAX_PARAMETERS_EXCEEDED, which isb's error.bhangs; it was never written to the server.cresolves with[]instead of[{ c: 2 }]: it got the response meant for another query. Only then doesbfail, withERR_OUT_OF_RANGE.Cause:
submit()insrc/connection.jsputs the query inquery/sentbeforebuild()/toBuffer()run. When either throws, thecatchcallserrored(error), which rejects the active query instead of the failing one, and the failing query stays insentas if it had been written. From then on, responses are matched to the wrong queries.This should come first in the correctness batch, independent of the dispatch policy in #18.
Tracked in #20.
The #20 review found two related paths where a connection accepts queries mid-exchange (a retry and COPY). Tracked in #21; possibly also porsager#1234.
[-]Upstream reports not yet fixed in the fork[/-][+]Upstream Postgres.js reports: what the fork has and hasn't fixed[/+][-]Upstream Postgres.js reports: what the fork has and hasn't fixed[/-][+]Upstream Postgres.js reports tracked by the fork[/+]okomarov commentedon Oct 16, 2026
Every report listed here now has its own issue, labelled by area and kind and placed on the Roadmap project, so this list is no longer kept up to date. Issues answering upstream reports carry the
upstreamlabel: open ones. Fixed reports are in the README and the changelog.[-]Upstream Postgres.js reports tracked by the fork[/-][+][MOVED, NOT FIXED] Upstream reports the fork tracks: each now has its own issue on the Roadmap project[/+]