Skip to content

Parsing error when defining min_protocol_version=3.2 #2525

@amotl

Description

@amotl

Hi. First things first: Thanks a stack for your excellent work on pgx. It is a true gem.

Problem

With the new support for the PostgreSQL protocol version 3.2 added with GH-2498 (thank you, @dbussink!), and the corresponding logic to handle erroneous value assignments that balance between both new options min_protocol_version vs. max_protocol_version, and their corresponding default values, currently, when defining

min_protocol_version=3.2

... this error is emitted:

2026/03/24 01:46:21 cannot parse `postgres://crate@localhost:5432/testdrive?min_protocol_version=3.2`:
min_protocol_version cannot be greater than max_protocol_version

The error message does not give the average user any indication about why that happens, while they were innocently trying to connect to the server using a specific minimum PostgreSQL protocol version.

Wish

When there are no objections, we think the optimal parsing and validation logic should be adjusted to be more DWIM, so that it's sufficient to provide min_protocol_version=3.2 without further ado.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions