Skip to content

Refactor PostgreSQL Connection-Level Parameters Handling #4890

@rahim-kanji

Description

@rahim-kanji

Issue Description:

Currently, ProxySQL enforces a strict subset of PostgreSQL connection parameters as per the official documentation, rejecting any undocumented parameters. However, actual PostgreSQL servers accept additional parameters (e.g., extra_float_digits) and apply them at the connection/session level. To align with PostgreSQL's behavior and improve compatibility, ProxySQL should:

  • Accept all connection parameters provided by clients, not just the documented subset.
  • Defer parameter validation until after successful authentication to optimize resource usage.

Proposed Changes:

  1. Remove Parameter Whitelist Enforcement:

    • Current Behavior: ProxySQL validates parameters against a static list from PostgreSQL documentation and rejects unrecognized ones.
    • New Behavior: Accept all parameters sent by the client, mirroring PostgreSQL's permissive handling. For example, extra_float_digits or other session parameters/variables should be accepted and forwarded to the server.
  2. Defer Parameter Validation Until Post-Authentication:

    • Current Behavior: Parameters are validated during the connection handshake, regardless of authentication success.
    • New Behavior: Validate and apply parameters only after successful authentication. This avoids wasting resources on invalid connections (e.g., failed logins).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions