Repository navigation
chore(deps): update dependency postgres to v4 - #1089
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
renovate
Bot
force-pushed
the
renovate/postgres-4.x
branch
2 times, most recently
from
November 11, 2026 10:36
4d88870 to
edd6396
Compare
renovate
Bot
force-pushed
the
renovate/postgres-4.x
branch
2 times, most recently
from
November 20, 2026 21:40
a91f20d to
67c8bc4
Compare
renovate
Bot
force-pushed
the
renovate/postgres-4.x
branch
from
November 25, 2026 12:54
67c8bc4 to
6e86ef4
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
^3.4.7→^4.0.0Release Notes
porsager/postgres (postgres)
v4.2.0Compare Source
New
debugevery query captured one up front. Now nothing is captured for queries that succeed, and a failing one gets the stack the runtime builds when yourawaitresumes, through each async function above it: query errors, errors insidesql.beginandsql.reserve, cursors,forEach,.describe(), and a failed connection forsql.beginorsql.reserve. Synchronous functions that only pass a query on without awaiting it aren't part of an async stack, and Bun's runtime doesn't yet follow the chain through a query, so there the stack has none of your frames.sql.beginorsql.reservewaiting for a connection can be cancelled (#1322). Their promise has.cancel()and.signal(), as a query does. While it waits, either takes it out of the queue and rejects it with57014, so the transaction callback never runs and no connection is handed over. Before, a caller with a deadline could not give up its place, and the callback ran once a connection freed up. Once it has its connection, both do nothing.sql`…`.transform(false)gives a query's results without the instance'stransform(#1333). Its columns keep the server's names, and its values and rows are what the server and its parsers give, so a query with.parsers()gets exactly what its parsers return. Code given an app'ssql, a transaction or a reserved connection can't see the app'stransform, and withpostgres.camelthe keys of its JSON values were renamed. With a column transform, each ofresult.columnsalso has_name, the name the server gave the column..parsers()gets the column's position (#1333)..parsers((column, i) => …)can pick a parser for each of several columns with the same name.decodeon a custom type (#1335). A custom type can read its values from the bytes of their text withdecode(x, start, end), so no string is made forparse. It returns whatparsewould, and reads the type's columns in query results,.parsers()included. Arrays of the type still go throughparse, and a type withoutdecodeis read as before. Readingtimestamptzas an ISO string with microseconds andint8as aBigIntthis way, 25,000 rows of 12 columns took about half the CPU and less than half the memory allocated.require_authlimits the authentication methods the server may ask for, as libpq's (#1348). A comma separated list ofpassword,md5,gss,sspi,scram-sha-256andnone, or the same with!to allow all but those, also in the url or asPGREQUIREAUTH. Any other request ends the connection withAUTH_METHOD_REFUSEDbefore anything is sent, so a server that isn't the one you meant to reach can't ask for the password in the clear.InstantorZonedDateTimeis written fortimestamptz, aPlainDateTimefortimestamp, aPlainDatefordate, aPlainTimefortimeand aDurationforinterval, andinfer: truetypes them so. They are sent without the time zone and calendar annotations, years before 1 as BC and a negative duration with each field negative, since PostgreSQL reads neither[Europe/Copenhagen]nor-P1D. Before, any Temporal value threw aTypeError, whatever the parameter's type. Results are stillDates, and custom types withparseread them as Temporal.Fixed
.cancel()or.signal()between them only sent a cancel request, which found nothing running, so the second part ran the query anyway. It is now not written, and the query rejects with57014; in a transaction the transaction fails, as with any canceled query.unlisten()resolves while the server can't be reached or refuses connections (#1359). It sentUNLISTENeven when the listening connection was gone, so it waited for a new connection, as long as the reconnect backoff, and then rejected with that connection's error:ECONNREFUSED,CONNECT_TIMEOUT, or one the server sent, such as57P03while it starts up. A lost connection already ended itsLISTEN, sounlisten()now only drops the channel then, and aLISTENthat was being sent again on reconnect is followed by anUNLISTENonce it's back. The channel's retry timer is cleared too, so it no longer kept the process alive for up to 20 seconds after the lastunlisten().57P01) or a connection exception (class08) counted as the server's answer, so the pool marked types loaded with none read, and arrays of custom types came back as text for the rest of its life.CHANNEL_BINDING_REQUIREDor a protocol error came back asCONNECTION_CLOSED.sql.array()is a type error (#1354, #1355). It was declared as returningnever, which TypeScript accepts as any value, so code from 3.x compiled and then threwARRAY_REMOVED.Datebefore year 1 or after year 9999 is written in a form PostgreSQL accepts (#1356).toISOString()writes those years with a sign and six digits, so a date read from the database couldn't be written back.PROTOCOL_ERROR, as in libpq (#1346). Only row descriptions, rows, parameter descriptions, copy data, errors, notices, notifications and function results may be longer than 30,000 bytes; any other was taken at its word up to 1 GB, so a stream out of step allocated a buffer that size and waited for it.onreadis used on Deno 2.8 and later (#1346). Earlier versions don't implement it, so a plain connection threwNot implemented: LibuvStreamWrap.prototype.useUserBuffer.NO_COLUMNS(#1341).sql([])builtinsert into x (). Columns given beside it,sql([], 'a'), still build("a")..signal()replaces the first, and a cursor's async iterator clears its timer and abort listener (#1342). The first signal stayed attached and could still cancel the query, and an iterator that finished left itsquery_timeouttimer and listener behind.sentis when its bytes are written (#1347). It was set when the query was accepted, before the write that waits for the current turn to end.node:tls, at least in Deno 2.1 which Supabase Edge Functions run, corrupts what it reads after a pause and resume, so a result spanning more than one read failed withPROTOCOL_ERRORor hung, and a misread message length under 1 GB was allocated as a buffer of that size. Startup now holds what arrives during the handover instead of pausing, as v3 never paused there.Date,Bufferorsql.typed()value insql([...])is one value, not a row (#1326). Aninlist took any object as a row, sosql([date])becamein (null), two dates a syntax error, and aBufferor typed value was split into its fields, so the list matched the wrong rows without an error.sql.subscribe()takes the command in any case (#1327).'INSERT:users'was accepted but kept as written, while events arrive asinsert, so its callback never ran.portin a url orPGPORTgives one port per host, as libpq does (#1328). Each host gotNaN. A list whose length doesn't match the hosts throws.maxfrom a url orPGMAXis a number (#1337). It stayed a string, so?max=1didn't turn the scheduler off asmax: 1does.--or/* */comment before${ sql(...) }was read as SQL when the helper looked back for its clause, so a comment with a word likefromorwherein it, or an apostrophe, madeinsert into x -- rows from the import ${ sql(row) }orupdate x set -- the user's name ${ sql(row) }fail withTypeError: x.replace is not a function. Comments are now skipped, nested block comments included, while--and/*inside quoted strings, quoted identifiers and dollar quotes are left alone.falseordisablein aPG…environment variable turns that option off (#1340), as it already did in a url.PGPREPARE=false,PGFETCH_TYPES=falseandPGSCHEDULER=falsewere kept as the string, which counts as on, so the option stayed enabled.UNLICENSEis now in the package'sfiles, since npm only adds a file namedLICENSEorLICENCEon its own.next()gave the query arejecttied to its own promise, which had already resolved with the last batch while the loop body ran. An error from the connection closing then was lost, and the nextnext()ended the loop as if all rows had been read, sofor await … of query.cursor(n)returned a partial result without an error. The error is now kept and thrown from the nextnext(), ascursor(n, fn)rejects with it.sql.batchqueued behind another query honorscancel_timeout.cancelBatchdid not start the silence timer thatcancel()starts for a queued query, so the batch and itscancel()stayed pending when the earlier query never finished.timestamptz,timestampordateparameter is written as epoch milliseconds again (#1324). 4.0 sent a number as its digits before the server had named the parameter's type, so${ Date.now() }for a timestamp failed with22008, where v3 wrote it as that instant. The first time a statement with a number parameter runs, the pool now waits for the server's parameter types, at the cost of one round trip, and remembers them for that statement.sql.typed()is written as its own type when the server types the other parameters (#1334). A statement with an untyped parameter learns its parameter types from the server, and once it had them it wrote every value with the serializer of the server's type, a typed value included. JSON text typed asunknown(705) for ajsonbparameter went throughJSON.stringifyagain and was stored as a JSON string, from the statement's second run on, or from its first when the untyped value was notnull.Performance
${ sql(...) }for the clause it belongs to tested each character with a regular expression. It now compares character ranges, so building a query with helpers takes over a quarter less time on one line, and 60% less for a helper 30 lines after itsselect.debug: trueno longer costs anErrorfor every query. The stack it captured up front is replaced by the native one, so a successful query withdebugon takes less than half the time it did.max: 10and about a third of it atmax: 90.v4.1.1Compare Source
Fixed
sql.beginsends after its ownCOMMITorROLLBACKis rejected (#1320). A statement the callback did not await, sent between the transaction'sCOMMITorROLLBACKand the release of its connection, ran outside the transaction, and after a rollback its write was kept. It now rejects withUNSAFE_TRANSACTION, as a statement after the transaction has ended does.sql.unsafe('select …; rollback')theROLLBACKresult had the columns of theSELECTbefore it..cursor()yields the rows ofSHOW,EXPLAINand other commands without a row count. Their last batch was only passed on when the command tag had a count, so a cursor over them yielded nothing.PGSSLMODEis kept when a url hassslrootcert,sslcertorsslkey. Such a url without ansslmodeusedrequireeven ifPGSSLMODEwas set, soPGSSLMODE=verify-fulldropped the host name check andPGSSLMODE=disableused TLS.stackrejects the waiting queries (#1312). Adding the calling line to such an error threw, so the queries waiting for a connection never settled and the pool stopped retrying. On Bun a DNS error such asEAI_AGAINhas nostack, so a query to a host that doesn't resolve hung forever.sql.batchno longer keeps the process alive forcancel_timeout(#1317, #1318). The timer that waits for the cancel to be answered was left running after the batch rejected, so the process stayed up for 5 seconds aftersql.end()._no longer makestoCamelandtoPascalthrow (#1313). Withtransform: postgres.camel, such a key made the whole query throw. The trailing_is now kept, soa_staysa_, and an empty key stays empty instead of becomingundefined.v4.1.0Compare Source
New
query_timeout(#1278). Seconds a query may take, waiting for a connection and running together, before it is canceled and rejects withQUERY_TIMEOUT. Off by default. Unlikestatement_timeoutit also ends a query whose server or network has gone silent, which TCP alone takes many minutes to notice. Transaction control queries andforEachare limited too; cursors, streams andsql.listenare not.cancel_timeout, 5 seconds by default: how long a canceled query may take to end before its connection is closed.sql.batch([queries])sends queries in one round trip with a single Sync: outside a transaction they commit or roll back together, and the batch rejects with the failing query's position inerror.index.jsonon a transform (#1169). The built-in transforms rename the keys of JSON values in results but send JSON values as they are.json: falseleaves JSON values as they are both ways, andjson: truerenames their keys when sending too, with the transform'scolumn.to. Without it nothing changes.eager_types:truereads array types and domains when the pool starts instead of when a query first meets one.sql.identifier(...parts)(#1292). An identifier from its parts, each quoted as it is and joined with., for a name that contains a dot, whichsql(name)reads as a separator:sql.identifier('acme.inc', 'users')gives"acme.inc"."users". Thetransformis not applied. With no parts it throwsNO_PARTS.enginesis>=18and CI runs it. Nothing in Postgres.js needs 20;using,await usingand tracing are used where the runtime has them. Loading it withrequirestill needs Node.js 20.19 or 22.12.sql`...`.parsers(parsers)(#1294). A query's own parsers, for its rows only: by type,{ [oid]: parse }, on top of the instance'stypes, or a function that gets each column and returns the parser for it,nullfor the server's text. A library that knows how to decode some queries' columns can decode them once, inside the row reader, while every other query on the instance and its pool keeps the instance's parsers. Such a query receives every column as text, sobyteaand the integer arrays otherwise read in binary reach its parsers as text. A query without.parsers()reads its rows as before.Fixed
sql.listenkeeps its connection after the lastunlisten()(#1298). The connection was closed so the process could exit (#1022), which made every followinglisten()connect again: about 3.5 ms instead of 0.1 ms perlisten. It now stays open without keeping the process alive once nothing is listened.PGSSLMODEis read (#1307). It was ignored, soPGSSLMODE=verify-fullconnected in plain text without an error. This may change how existing setups connect:requirenow uses TLS and fails against a server without it, andverify-caandverify-fullcheck the certificate against Node's CAs, not~/.postgresql/root.crtorPGSSLROOTCERT. A url or anssloption still comes first.insert into ${ sql('s') }.t ${ sql(row) }orinsert into "s".t, the quoted schema and the table were read as two words, so the row was taken for a list of identifiers and threwx.replace is not a function.sql.listenkeeps reconnecting when its first reconnect fails (#1285, #1286). After the listen connection closed, it was reopened once, and if that attempt failed, as it does while a restarting server still refuses connections, nothing tried again, soonlistenwas never called and notifications were lost. A failed reconnect is now retried afterbackoff, until it succeeds, the channel is unlistened or the pool ends..cancel(),.signal()and nowquery_timeoutsend a cancel request and waited for the server to end the query, so a server or network gone silent left both the query and the promise.cancel()returns pending until TCP gave up. This applies to every cancel, also withoutquery_timeout: when the server doesn't answer withincancel_timeout, the connection is closed and the pool connects again. Whether the queries on it ran is unknown, so they reject withCONNECTION_DESTROYED(a timed out one withQUERY_TIMEOUT) whosecauseisCANCEL_UNANSWERED, not with57014. The cancel request's own connection is limited bycancel_timeouttoo, and a cancel is no longer sent for a query whose result has already arrived, where it could only hit the query after it. A cancel request whose own connection fails, as over TLS to a server gone silent, no longer crashes the process with an unhandled rejection. A query that times out while it waits behind another one on its connection is canceled only after it has had its ownquery_timeoutonce its turn comes, instead of the moment its turn comes, when it had usually finished and the cancel stopped the next query; if the server sends nothing forcancel_timeoutwhile it waits, the connection is closed. A query waiting for types to be read rejects withQUERY_TIMEOUTwithout closing its connection, and the read of array types and domains is limited byquery_timeouttoo.sslrootcert,sslcertandsslkeyin a url are used (#1308). They were sent to the server as startup parameters, so?sslrootcert=systemfailed withunrecognized configuration parameter. Files are read intoca,certandkey. As in libpq, a root certificate withrequireorverify-cachecks the CA but not the host name, andverify-fullchecks both, as doesssl: true. A file without ansslmodemeansrequire.transaction_timeout(25P04), anidle_in_transaction_session_timeout(25P03) orpg_terminate_backend(57P01) ended the session,sql.beginrejected withCONNECTION_CLOSED, so a timeout or a termination looked the same as a network drop; it now rejects with the FATAL error the server sent before closing, as a query in flight already did, and a later query on that connection rejects withCONNECTION_CLOSEDthat has it ascause. A server restart or failover ends sessions with57P01, so code that retries a transaction onCONNECTION_CLOSEDshould retry on that code too. A FATAL in answer toCOMMITrejects withCONNECTION_CLOSEDthat has it ascause, as the outcome is unknown, as it is when the connection is lost duringCOMMIT.ssl: 'verify-full'orssl: trueand an IP as the host, a connection upgraded to TLS checked the certificate againstlocalhost, so a certificate forlocalhostfrom a trusted CA passed for any IP and a correct certificate for the IP failed. Direct TLS was not affected.beginrejects when its transaction's connection is lost (#1281, #1282). One whose callback was still running when the connection went resolved with the callback's result after the transaction had already rejected; it now rejects with the transaction's error.backoffand waiting queries reject onceconnect_timeouthas passed, instead of reconnecting as fast as the server accepts for as long as it keeps closing. Withconnect_timeoutset to 0, null or false the pool now keeps trying for as long as it takes, as the option says, also after a refused or closed startup, which used to reject the waiting queries at once.FATALerror gives that error to the queries pipelined behind it as well, instead ofCONNECTION_CLOSED.Sfield is recognised as one. The non-localizedVfield is optional in the protocol: PostgreSQL sends it since 9.6, and a pooler that builds its own errors, such as PgBouncer, may send only the localizedS. Such an error was not seen as FATAL, so the query, asql.beginand the queries pipelined behind it rejected withCONNECTION_CLOSEDwithout acauseinstead of with the error.error.severitynow falls back toseverity_localwhenVis missing.queryandparameters.prepare: falseavoids it.copy ... to stdoutstream frees the connection (#1306). Afterdestroy(), breaking out offor awaitor a failedpipeline, the connection stayed paused for good and the queries behind it never ran. The rest of the copy is now read and dropped, so the connection is free once the server has sent it. The query is not canceled, so in a transaction the next query still succeeds.Performance
sslobject with acabuilds its TLS context once (#1280). The connections made with it share one context instead of each parsing the wholecalist again, so with a provider's CA bundle a new connection takes about half the time and CPU, and a burst of them no longer blocks the event loop. Replacing one of the object's values, as with a renewedcert, builds a new context for the connections after it.nullis prepared, described and run in one round trip, as one whose parameter types are all known is, since those values are written the same for any type the server picks; one with other values only the server can type is still described first, once per connection.backoff, and onceconnect_timeouthas passed the connections waiting for it are closed and their queries reject, as for a failed startup.eager_types: truereads them when the pool starts, as before.timestamptz, andtimestampanddateread as UTC, are decoded straight from the bytes when they use the built-in parsers, with the text parser for anything else (BC,infinity, years before 1000); about 20% more rows per second for rows with timestamps.byteaand arrays ofint2,int4,int8andboolare fetched in binary once a prepared statement's columns are known on the connection, when they use the built-in parsers: the values are the same as from the text, about 4.5 times faster to read forbyteaand 3 times for anint4[]. A custom parser for the type or its elements, andraw(), still get the text.v4.0.0Compare Source
v4 rewrites everything below the public API: the pool, the connection, the protocol, startup and the socket layer. Queries, helpers, transactions, cursors, COPY, listen, subscribe, large objects and the options work as in 3.4.9, apart from the changes below.
Security
database,userorconnectionvalue 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 withreplicationoroptionsset. A NUL in any protocol string, also in query text and identifiers, now rejects withNUL_CHARACTER.__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 insql.subscriberows alike.Upgrading from v3
The README has an upgrade guide, with a query that shows whether the change in parameter types concerns you.
infer: falseby default) (#392). v3 typed aDateastimestamptz, a boolean, aBuffer, abigintand arrays of these from JavaScript; v4 sends them without a type and writes each value for the type the server asks for, as libpq does.timestamptzcolumns, values written to a column of their own type, strings, numbers and anything cast work as before. Outside UTC, aDatewritten to or compared with atimestampordatecolumn is taken as UTC instead of the session's local time, and atimestampis read as UTC, so it comes back as the instant that was written whatever the time zone. ADatewhere the query doesn't decide its type, such as indate_trunc('day', ${ date }), needs a cast (${ date }::timestamptz).infer: truekeeps v3's behaviour.requirecan load on Node.js 20.19 and 22.12 and later (require('postgres').default).sql.array()is removed. Pass the array as it is, with a cast where the query doesn't decide its type:${ ids }::int[]. Callingsql.array()throwsARRAY_REMOVED.sql.beginrejects withTRANSACTION_ROLLED_BACK; v3 took it as a commit.sqlafterrelease(), or on a transaction'ssqlafter it has committed or rolled back, rejects; v3 ran it on whatever connection it then had. Releasing a reserved connection while its ownBEGINis still open closes it instead of returning an open transaction to the pool.beginoutsidesql.begin, a reserved connection ormax: 1rejects withUNSAFE_TRANSACTIONand is rolled back. A query that looks like it may open a transaction runs alone on its connection, so nothing else lands in it, and any query that leaves its connection in a transaction is rolled back and rejected. v3 rejectedBEGINbut left the transaction open. A script that opens and closes its own transaction in one query, such as a migration file withBEGINandCOMMIT, runs; v3 ran it and still rejected it.sql.begin(#1236, #1238) or one opened by hand on a reserved connection, just as a server error would: the queries after it fail with25P02and a laterCOMMITanswersROLLBACK. v3 skipped the query and let the rest commit.int[]comes back as an array of numbers; v3 returned the text.53300) is retried withbackoffuntilconnect_timeouthas passed, and the waiting queries reject with that error only then. Such a refusal is often momentary: connections opened at the same time against a connection limit can all be refused while the server counts them. v3 rejected the queries of the refused connection at once.target_session_attrsrejects withCONNECTION_DESTROYEDinstead of retrying forever.AUTH_TYPE_NOT_IMPLEMENTEDinstead of waiting for the connect timeout.onerroris logged. When thesql.subscribestream fails and none of its subscriptions has anonerror, the error goes toconsole.errorbefore the stream reconnects; v3 dropped it. Passonerrorto handle or silence it.infinitytimestamps areInfinityand-Infinity, both ways, instead of an invalidDate.import postgres, { type Sql } from 'postgres'). A reserved connection is no longer typed as havingbeginandend, which it never had.New
scheduler: falsepipelines on the busy connection with the fewest queries in flight instead; v3 went round-robin over the busy connections. Withmax: 1it is off, as there is only one connection.queue_timeout: seconds a query, transaction or reserve may wait for a connection before it rejects withQUEUE_TIMEOUT, unsent (#1036, #824)..signal(abortSignal)on a query: aborting rejects it if it is still waiting, or cancels it if it is running..cancel()or an aborted.signal()while the cursor's callback runs, or while an async iterator over it is between batches, fetches no more rows, closes the portal and rejects with57014. v3 sent a cancel request that the idle server ignored, so the cursor ran on to the end (or, arriving late, could cancel the next query).sql` and `.join(items)joins fragments and values with a fragment as separator, leaving out falsy items and adding spaces where missing (#807, #813).sql.begininside a transaction runs in a savepoint (#985).sql.rollback()rolls back a transaction, or the savepoint it is called in, without throwing;sql.beginresolves with the callback's result (#500).Promise.allbetween awaited ones are sent together and run in the order they were made (#951).toandfromcan be type names, looked up when the pool starts, with array types, for extension types such as pgvector (#1115, #719).usingandawait using:sqlends the pool and a reserved connection is released when it goes out of scope (#886, #1094).unref_sockets: truelets the process exit while connections are idle, likeallowExitOnIdlein node-postgres (#869, #918).min: connections kept open once the pool is used;idle_timeoutcloses only those above it (#672).useras a function, called each time a connection opens, likepassword, for credentials that rotate (#881).PGPASSFILEor~/.pgpassis read as libpq reads it (#964).name => valuearguments,make_interval(${ sql({ days: 1 }) })(#1040).copy ... from stdinwritable hascountandcommandonce it has finished, with the number of rows the server copied (#465).slot: 'name'keeps the slot ofsql.subscribeacross restarts and streams from where it was last confirmed. A transaction is confirmed only once its handlers have finished, a handler that fails gets its transaction delivered again, and handlers may be async: they run one after the other in commit order while the stream waits.sql.subscribe:truncateevents, and thelsn,timeandxidof the transaction on every change. Reconnecting retries with backoff.tls-server-end-point) when the server offers it, binding the login to the server certificate.channel_bindingis'prefer'by default,'require'or'disable'as in libpq, also from the url orPGCHANNELBINDING;'require'rejects an unbound connection withCHANNEL_BINDING_REQUIRED(#1008).sslnegotiation: 'direct'(PostgreSQL 17+) is opened as TLS from the first byte and is the fastest encrypted connection.workerdexport condition, oncloudflare:sockets, with TLS bystartTls.query.textandquery.parametersshow the text and values a query will be sent with, before it is sent.sql.stats: connections, opening, idle, leased and waiting, right now.postgres:query,postgres:connectandpostgres:transactionas diagnostics tracing channels, andpostgres:poolandpostgres:noticeas plain channels, for OpenTelemetry and other tracers without an option or a wrapper. Nothing is published, and nothing costs, without a subscriber. See Tracing.max: 1only for a query that is alone on the connection, so queries keep their order. v3 kept failing until the connection was replaced. Each connection reads rows and writes values only by what its own server described for the statement. When one connection sees a statement describe differently, the others prepare it again before their next use instead of trusting what they learned before.sql.close()closes the connections once their queries are done and leaves the pool usable.options.socketis also called with the host and port, and a socket can say it has done TLS itself (negotiated: true).onread: falsereads through the socket stream instead of a shared buffer, should a runtime ever misbehave with it.Fixed
The open issues and pull requests were triaged into 33 correctness bugs, each with a regression test in the v4 suite. Among them:
data_type_name; v3 set it as'data type_name', with a space, and typed it astype_name.JSON.stringifyof aPostgresErrorincludes its message (#767, #1132).readable({ start, end })stops atend; v3 ignored it and read to the end of the object.file://urls.TLS_HANDSHAKE_FAILEDinstead ofCONNECTION_CLOSEDorCONNECT_TIMEOUT(#1213), andperf_hooksis no longer imported (#990). Writes are split into 16 KiB pieces, as Workers were reported to drop a plain connection on a larger write (#1268).42P05(#960).ISqlis exported for functions that take the pool, a transaction or a reserved connection (#1163, #1150);PostgresErroris exported by name as a value as well as a type (#862, #703); nested arrays withnulland other values in helpers (#743); a typed query with a helper inside (#958); column lists that arestring[], while unknown literal columns are still caught (#916); class instances andobjectas JSON (#664, [#625](https://rConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.