Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf/4736~1
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/4736
Choose a head ref
  • 9 commits
  • 25 files changed
  • 3 contributors

Commits on Feb 19, 2025

  1. libpq: Add PQfullProtocolVersion to exports.txt

    This is necessary to be able to actually use the function on Windows.
    JelteF authored and Commitfest Bot committed Feb 19, 2025
    Configuration menu
    Copy the full SHA
    ba04005 View commit details
    Browse the repository at this point in the history
  2. libpq: Trace NegotiateProtocolVersion correctly

    This changes the libpq tracing code to correctly trace the
    NegotiateProtocolVersion message. Previously it wasn't important that
    tracing of the NegotiateProtocolVersion message worked correctly,
    because in practice libpq never received it. Now that we are planning to
    introduce protocol changes in future commits it starts to become more
    useful for testing/debugging.
    JelteF authored and Commitfest Bot committed Feb 19, 2025
    Configuration menu
    Copy the full SHA
    3a0e369 View commit details
    Browse the repository at this point in the history
  3. libpq: Handle NegotiateProtocolVersion message differently

    Previously libpq would always error when the server returns a
    NegotiateProtocolVersion message. This was fine because libpq only
    supported a single protocol version and did not support any protocol
    parameters. But we now that we're discussing protocol changes we need to
    change this behaviour, and introduce a fallback mechanism when
    connecting to an older server.
    
    This patch modifies the client side checks to allow a range of supported
    protocol versions, instead of only allowing the exact version that was
    requested. Currently this "range" only contains the 3.0 version, but in
    a future commit we'll change this. In addition it changes the errors for
    protocol to say that they error because we did not request any
    parameters, not because the server did not support some of them. In a
    future commit more infrastructure for protocol parameters will be added,
    so that these checks can also succeed when receiving unsupported
    parameters back.
    
    Note that at the moment this change does not have any behavioural
    effect, because libpq will only request version 3.0 and will never send
    protocol parameters. Which means that the client never receives a
    NegotiateProtocolVersion message from the server.
    JelteF authored and Commitfest Bot committed Feb 19, 2025
    Configuration menu
    Copy the full SHA
    cfced9b View commit details
    Browse the repository at this point in the history
  4. libpq: Add min/max_protocol_version connection options

    All officially supported version of the PostgreSQL server send the
    NegotiateProtocolVersion message when an unsupported minor protocol
    version is requested by a client. But many other applications that
    implement the PostgreSQL protocol (connection poolers, or other
    databases) do not, and the same is true for many unspported PostgreSQL
    server versions. Connecting to such other applications thus fails if a
    client requests a protocol version different than 3.0.
    
    This patch adds a max_protocol_version connection option to libpq that
    specifies the protocol version that libpq should request from the
    server. Currently all allowed values result in the use of 3.0, but that
    will be changed in a future commit that bumps the protocol version. Even
    after that version bump the default will likely stay 3.0 for the time
    being. Once more of the ecosystem supports the NegotiateProtocolVersion
    message we might want to change the default to the latest minor version.
    
    We also add the similar min_protocol_version connection option, to allow
    a client to specify that connecting should fail if a lower protocol
    version is attempted by the server. This can be used to ensure certain
    protocol features are in used, which can be particularly useful if those
    features impact security.
    JelteF authored and Commitfest Bot committed Feb 19, 2025
    Configuration menu
    Copy the full SHA
    58255c0 View commit details
    Browse the repository at this point in the history
  5. Use latest protocol version in libpq_pipeline tests

    To be able to test new protocol features added by future commits, we
    start requesting the latest protocol version in our libpq_pipeline test.
    JelteF authored and Commitfest Bot committed Feb 19, 2025
    Configuration menu
    Copy the full SHA
    af81259 View commit details
    Browse the repository at this point in the history
  6. Bump protocol version to 3.2

    In preparation of new additions to the protocol in a follow up commit
    this bumps the minor protocol version number. Instead of bumping the
    version number to 3.1, which would be the next minor version, we skip
    that one and bump straight to 3.2. The reason for this is that many
    PgBouncer releases have, due to an off-by-one bug, reported 3.1 as
    supported[1]. These versions would interpret 3.1 as equivalent to 3.0. So
    if we would now add extra messages to the 3.1 protocol, clients would
    succeed to connect to PgBouncer, but would then cause connection
    failures when sending such new messages.
    
    So instead of bumping to 3.1, we bump the protocol version to 3.2, for
    which these buggy PgBouncer releases will correctly close the connection
    at the startup packet. It's a bit strange to skip a version number due
    to a bug in a third-party application, but PgBouncer is used widely
    enough that it seems worth it to not cause user confusion when
    connecting to recent versions of it. Especially since skipping a single
    minor version number in the protocol versioning doesn't really cost us
    anything. So, while this is not the most theoretically sound decission,
    it is the most pragmatic one.
    
    [1]: pgbouncer/pgbouncer#1007
    JelteF authored and Commitfest Bot committed Feb 19, 2025
    Configuration menu
    Copy the full SHA
    ead6eda View commit details
    Browse the repository at this point in the history
  7. Add infrastructure for protocol parameters

    Since the introduction of the NegotiateProtocolParameter message the
    server has been able to say to the client that it doesn't support any of
    the protocol parameters that the client requested.
    
    While this is important for backwards compatibility, it doesn't give
    much guidance for people wanting to add new protocol parameters. This
    commit intends to change that by adding a generic infrastructure that
    can be used to introduce new protocol parameters in a standardized way.
    
    There are two key features that are necessary to actually be able to use
    protocol parameters:
    
    1. Negotiating the valid values of a protocol parameter (e.g. what
       compression methods are supported). This is needed because we want to
       support protocol parameters without adding an extra round-trip to the
       connection startup. So, a server needs to be able to accept the data
       in the StartupMessage, while also sharing with the client what it
       actually accepts in its response.
    2. Changing a protocol parameter after connection startup. This is
       critical for connection poolers, otherwise they would need to
       separate connections with different values for the protocol
       parameters.
    
    To support these two features this commit adds three new protocol
    messages, including their code to handle these messages client and
    server side:
    
    1. NegotiateProtocolParameter (BE): Sent during connection startup when the
       server supports the protocol parameter. This tells the client if the
       server accepted the value that the client provided for the parameter.
       It also tells the client what other values it accepts.
    2. SetProtocolParameter (FE): Can be used to change protocol parameters after
       the connection startup.
    3. SetProtocolParameterComplete (BE): Response to SetProtocolParameter
       which tells the client if the new value was accepted or not.
    JelteF authored and Commitfest Bot committed Feb 19, 2025
    Configuration menu
    Copy the full SHA
    6f335a0 View commit details
    Browse the repository at this point in the history
  8. Add report_parameters protocol parameter

    Connection poolers use the ParameterStatus message to track changes in
    session level parameters. Before assinging a server connection to a
    client, the pooler will first restore the server parameters that the
    client expects. This is done to emulate session level SET commands in
    transaction pooling mode.
    
    Previously this could only be done for a hard-coded set of backend
    parameters, but with this change a connection pooler can choose for
    which additional backend parameters it wants to receive status changes.
    It can do this by setting the newly added report_parameters protocol
    parameter to a list of parameter names.
    JelteF authored and Commitfest Bot committed Feb 19, 2025
    Configuration menu
    Copy the full SHA
    5209b68 View commit details
    Browse the repository at this point in the history
  9. [CF 52/4736] v17 - Add new protocol message to change GUCs to be able…

    … to change protocol extension parameters
    
    This commit was automatically generated by a robot at cfbot.cputube.org.
    It is based on patches submitted to the PostgreSQL mailing lists and
    registered in the PostgreSQL Commitfest application.
    
    This branch will be overwritten each time a new patch version is posted to
    the email thread, and also periodically to check for bitrot caused by changes
    on the master branch.
    
    Commitfest entry: https://commitfest.postgresql.org/52/4736
    Patch(es): https://www.postgresql.org/message-id/CAGECzQRbAGqJnnJJxTdKewTsNOovUt4bsx3NFfofz3m2j-t7tA@mail.gmail.com
    Author(s):
    Commitfest Bot committed Feb 19, 2025
    Configuration menu
    Copy the full SHA
    7fbe3d6 View commit details
    Browse the repository at this point in the history
Loading