Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jackc/pgx
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.9.0
Choose a base ref
...
head repository: jackc/pgx
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.9.2
Choose a head ref
  • 12 commits
  • 21 files changed
  • 5 contributors

Commits on Mar 22, 2026

  1. Add failing test: batch scan corrupted in cache_statement mode

    sendBatchExtendedWithDescription passes eqb.ResultFormats to
    SendQueryStatement by reference. The next Build call reuses the backing
    array (reset sets len=0, append overwrites), corrupting the stored format
    codes for earlier queries. The server sends binary data (Bind was encoded
    correctly), but the local scan plan uses the corrupted text format code.
    
    Introduced in v5.9.0 by c3a1750 ("pgx batch uses SendQueryStatement"),
    part of "Skip Describe Portal for cached prepared statements reducing
    network round trips". The previous SendQueryPrepared path sent Describe
    Portal, so the server's RowDescription provided correct format codes
    regardless of the stored slice contents.
    
    Signed-off-by: Dirkjan Bussink <[email protected]>
    dbussink committed Mar 22, 2026
    Configuration menu
    Copy the full SHA
    3ce6d75 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #2524 from dbussink/pipeline-result-format-reuse

    Add failing test: batch scan corrupted in cache_statement mode
    jackc authored Mar 22, 2026
    Configuration menu
    Copy the full SHA
    f7b90c2 View commit details
    Browse the repository at this point in the history
  3. Fix batch result format corruption when using cached prepared statements

    Copy ResultFormats slice before passing to SendQueryStatement, which
    stores it for later use. The extended query builder reuses the backing
    array on the next loop iteration, corrupting format codes stored for
    earlier queries in the batch.
    
    Fixes the bug exposed by the test in #2524.
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
    jackc and claude committed Mar 22, 2026
    Configuration menu
    Copy the full SHA
    6273188 View commit details
    Browse the repository at this point in the history
  4. Release v5.9.1

    jackc committed Mar 22, 2026
    Configuration menu
    Copy the full SHA
    4e4eaed View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2026

  1. Update max_protocol_version and min_protocol_version defaults

    When `max_protocol_version` is not explicitly set, the default value is
    set to "3.0". This is reasonable and is inline with the same behavior as
    libpq[1]. Though, what libpq attempts to do that was not being done here
    is to reasonably upgrade or auto-raise the value of
    `max_protocol_version` when it has not been explicitly set.
    
    Here, we're providing the same functionality. In libpq, this
    determination is based on the parsed config values. We do the same here,
    parsing the values in ParseConfig to validate and determine the
    appropriate default for max_protocol_version. The string fields on
    Config are then set accordingly, and re-parsed at connection time as
    before.
    
    After parsing, when `max_protocol_version` has not been explicitly set,
    if `min_protocol_version` is greater than 3.0, `max_protocol_version`
    defaults to `latest`; otherwise it defaults to 3.0 for compatibility
    with older servers/poolers that don't support NegotiateProtocolVersion.
    
    [1] postgres/postgres@285613c
    abrightwell committed Mar 26, 2026
    Configuration menu
    Copy the full SHA
    2f81f1f View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2026

  1. Merge pull request #2526 from abrightwell/abrightwell-min-proto

    Update `max_protocol_version` and `min_protocol_version` defaults
    jackc authored Mar 28, 2026
    Configuration menu
    Copy the full SHA
    acf88e0 View commit details
    Browse the repository at this point in the history
  2. Remove unstable test

    This test occasionally failed in CI. This test purported to test that
    context watch doesn't leak goroutines. But goroutines can be created
    at any time by the Go runtime. These goroutines could also finish at any
    time.
    
    To properly test for leaked goroutines, we would need to use something
    like go.uber.org/goleak. But I'd rather not add a dependency.
    
    The new context watch implementation doesn't manually create goroutines,
    so we can be reasonably confident that it doesn't leak goroutines
    without this test.
    jackc committed Mar 28, 2026
    Configuration menu
    Copy the full SHA
    96b4dbd View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2026

  1. Fix Stringer types encoded as text instead of numeric value in compos…

    …ite fields
    
    Named integer types implementing fmt.Stringer (e.g. protobuf enums) were
    encoded using their String() output instead of their numeric value when used
    inside composite type fields. This happened because TryWrapBuiltinTypeEncodePlan
    matched fmt.Stringer before TryWrapFindUnderlyingTypeEncodePlan could convert
    the type to its underlying integer.
    
    Extract fmt.Stringer handling into a new TryWrapStringerEncodePlan function that
    runs after TryWrapFindUnderlyingTypeEncodePlan. The wrapper loop's existing
    "first successful recursive plan wins" semantics ensures the right behavior:
    numeric codecs match for numeric OIDs, Stringer is used as fallback for text OIDs.
    
    Fixes #2527
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    jackc and claude committed Apr 3, 2026
    Configuration menu
    Copy the full SHA
    08c9bb1 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2026

  1. Configuration menu
    Copy the full SHA
    e34e452 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #2531 from dolmen-go/godoc-add-links

    doc: add godoc links
    jackc authored Apr 9, 2026
    Configuration menu
    Copy the full SHA
    a5680bc View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2026

  1. Fix SQL sanitizer bugs with dollar-quoted strings and placeholder ove…

    …rflow
    
    The simple-protocol SQL sanitizer treated $N found inside PostgreSQL
    dollar-quoted strings ($$...$$ and $tag$...$tag$) as placeholders and
    substituted them into what PostgreSQL considers literal text. A crafted
    arg value could then close the dollar-quote from inside and run
    arbitrary SQL (see the new proof-of-concept test in query_test.go).
    
    The lexer now recognizes dollar-quoted strings using PostgreSQL's tag
    grammar (from scan.l) and preserves their contents verbatim.
    
    Placeholder numbers are also clamped at MaxInt32 rather than silently
    overflowing. Previously "$92233720368547758070" wrapped to -10; if the
    wrap had landed on a valid positive index it would have aliased a
    different argument.
    
    Adds unit tests, fuzz seeds, and an integration PoC.
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
    jackc and claude committed Apr 19, 2026
    Configuration menu
    Copy the full SHA
    60644f8 View commit details
    Browse the repository at this point in the history
  2. Release v5.9.2

    jackc committed Apr 19, 2026
    Configuration menu
    Copy the full SHA
    0aeabbc View commit details
    Browse the repository at this point in the history
Loading