Bump github.com/jackc/pgx/v5 from 5.7.6 to 5.12.0
Type: Pull Request
State: Open
Association: Unknown
Comments: 1
(13 days ago)
(13 days ago)
dependencies go
Bumps github.com/jackc/pgx/v5 from 5.7.6 to 5.12.0.
Release notes
Sourced from github.com/jackc/pgx/v5's releases.
v5.11.0
This release adds direct PostgreSQL type scanning through
database/sqlon Go 1.27, improves compatibility with libpq connection strings and PostgreSQL date/time values, and includes further decoder hardening. See Changes for connection-string and date/time behavior changes that may affect existing applications.Features
- stdlib: support Go 1.27's
driver.RowsColumnScanner, allowing PostgreSQL types such as arrays and ranges to be scanned directly into Go values withoutpgtype.Map.SQLScanner. Existingdatabase/sqlscalar conversions andsql.Scannerbehavior are preserved. The minimum supported Go version remains 1.25.- Add
Rows.TypeMapto expose the type map used to decode rows, including rows created byRowsFromResultReaderthat have no underlyingConn. Custom implementations ofRows, including mocks, must add this method.- pgconn: add
Config.MaxProtocolMessageBodyLento configure the maximum incoming protocol message body size (carter-ya)- pgconn: add
ErrReadOnlyConnection,ErrReadWriteConnection,ErrPrimaryConnection, andErrStandbyConnectionsentinel errors fortarget_session_attrsvalidation, allowing callers to useerrors.Is(Adrian-Stefan Mares)- pgxpool: accept
pool_ping_timeoutin connection strings to configureConfig.PingTimeout. The default is zero; zero and negative durations mean no timeout (1991santhu)Changes
Name-based row-to-struct mapping now matches explicit
dbtags case-insensitively, with exact matches taking precedence so tags can still distinguish quoted column names that differ only by case (AlisinaDevelo)pgconn: resolve the OS user account only when no user is supplied by the connection string, environment, or service file, avoiding unnecessary account lookups and crashes in some restricted container environments. Home-directory defaults for password, service, and TLS files remain available independently of the account lookup. On Unix these now use
$HOMErather than the OS account's home directory (Mohamed MAACHE)pgtype:
date,timestampandtimestamptztext values are now parsed and written by a hand-written parser and encoder for PostgreSQL's ISO date/time format instead oftime.Parseandtime.Format. Go's layout language cannot express a variable-width year or the BC era, which is the root of the bugs below. The text scan path is roughly 2.5x faster fortimestampandtimestamptz. Bug fixes:
timestampandtimestamptzno longer silently move February 29 of a BC leap year to March 1 when encoding.time.Date(-4712, 2, 29, ...)was written as4713-03-01 BCand is now written as4713-02-29 BC. This affected ordinary four-digit BC years, not only extended-range ones.datewas never affected.timestampandtimestamptzcan now scan BC leap days.4713-02-29 BCpreviously failed withday out of range.datecould already scan them.- Years past 9999 can now be scanned.
10000-01-02 03:04:05previously failed to parse, sotimestampandtimestamptzvalues at the high end of PostgreSQL's range were unreadable over the simple protocol and in any other text-format result.time.Timearguments in the simple protocol now encode BC dates correctly, using the same timestamp encoder.- Fractional seconds beyond microsecond precision are rounded the way the server rounds them (round half to even, carrying into the rest of the value) instead of being kept at full precision. PostgreSQL never sends more than six fractional digits, so this only affects values from other sources.
Behavior changes:
datenow rejects impossible dates instead of normalizing them.2024-02-30returned2024-03-01and2024-13-01returned2025-01-01; both are now errors.timestampandtimestamptzalready rejected them.- All three types now reject values outside PostgreSQL's range for that type, in the binary format as well as the text format. PostgreSQL never sends out-of-range dates, so this only affects corrupt or hand-built input; the range
... (truncated)
Changelog
Sourced from github.com/jackc/pgx/v5's changelog.
5.12.0 (October 30, 2026)
This release fixes two security vulnerabilities with narrow triggering conditions but serious impact. Affected applications should upgrade to v5.12.0; see Security Fixes below.
It also adds batched transaction startup, client certificate policy controls, and per-query batch timing, and improves connection pool cancellation and type handling. Custom implementations of
BatchResults, including mocks, must add the newTxmethod.Security Fixes
- SQL injection in simple-protocol batches (GHSA-j38q-h3ph-jjpq, high severity). In pgx v5 before v5.12.0,
SendBatchusing the non-default simple protocol could allow arbitrary SQL execution with the application's database privileges when a queued query ends in a--comment without a newline and the next query has an attacker-controlled string argument on its first line. Batched queries are now separated by a newline to end such comments. Extended-protocol modes are unaffected. Reported byIgor Kupczyński (@igor-kupczynski).- Bypass of
require_authandchannel_binding=require(GHSA-95fj-3fxw-g62g, high severity). In pgx v5.9.0 through v5.11.0, applications relying on these settings without verifying the server's identity withsslmode=verify-full(or equivalent TLS verification) could accept an impersonating server that skips authentication. The attacker could read queries and parameters and return fabricated results. pgx now enforces authentication completion and required channel binding before accepting the connection. This vulnerability does not bypass TLS server certificate verification. Reported by@president-xd.Features
- Add
Batch.BeginTxandBatchResults.Txto begin a transaction as the first query of a batch, saving the round trip forBeginTx. CallBatch.BeginTxbefore queuing any queries, consume the begin query's result first, and close the batch before using the transaction. Withpgxpool.Pool.SendBatch, the connection remains acquired until the transaction is committed or rolled back. AddFailedBatchResultsfor wrappers that fail before sending a batch (Timo Furrer)- Add
TraceBatchQueryData.ReadStartTimeand per-query durations totracelogbatch query entries. These measure result consumption, including application time spent reading rows, rather than server execution alone (Yasser-Ameur)- pgconn: support the
sslcertmodeconnection parameter,PGSSLCERTMODEenvironment variable, andConfig.SSLCertMode. The default,allow, sends an available client certificate when requested;disableprevents sending one and skips loading certificate/key files;requirefails unless the server requests and receives a certificate.requiredoes not guarantee server-side certificate validation, disables TLS session resumption, and stops further host or TLS fallbacks when the certificate requirement fails (k-zshiba)- pgtype: add support for PostgreSQL 19's
oid8andoid8[](k-zshiba)Changes
- pgxpool: background attempts to satisfy
MinConnsandMinIdleConnsnow have a 60-second timeout, including connection hooks. Initial background connections preserve the constructor context's values but ignore its cancellation and deadline.- pgxpool: canceling
Acquireduring a health-check ping now returns promptly and lets a successful ping return
... (truncated)
Commits
b2ef08bUpdate changelog for v5.12.08199015Merge commit from fork5b1a6a0Merge commit from fork65a4125Merge pull request #2697 from b84330808/windows-default-servicefilef2701a0pgconn: only fall back when Windows service file is missingdb95468Merge pull request #2696 from k-zshiba/support-oid8fa2327dStart each query on a new line when joining a simple protocol batch2283b85pgconn: read the default service file from %APPDATA%\postgresql on Windowsefc0b74Merge upstream master into support-oid85a17450pgconn: require AuthenticationOk before ReadyForQuery- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Package Dependencies
Technical Details
| ID: | 16789853 |
| UUID: | 6197838717 |
| Node ID: | PR_kwDOT9XDb88AAAABMvi_NA |
| Host: | GitHub |
| Repository: | mehmtens/snipvault |