Skip to content

(change) PostgreSQL Connection Pool Configuration #4835

@gogbog

Description

@gogbog

Motivation

Currently the PostgreSQL retriever supports basic connection settings such as the uri, table, and custom column names. However, it doesn’t provide user-configurable settings for connection pooling (max connections, idle connections, connection lifetimes, timeouts, etc.).

For many production workloads, especially under high concurrency or when using managed cloud Postgres instances, having control over these pool settings is essential for performance, stability, and resource efficiency.

Requirements

Allow users to configure PostgreSQL connection pool parameters when using the postgresql retriever, instead of relying solely on driver defaults.

The configuration must:

  1. Add an optional pool section under the PostgreSQL retriever configuration.
  2. Map configuration values to the underlying Go database/sql pool settings - (MaxOpenConns, MaxIdleConns, ConnMaxLifetime, ConnMaxIdleTime)
  3. If pool is not defined, current behavior and defaults must remain unchanged.
  4. Validate configuration values

Proposed solution:

Introduce optional PostgreSQL retriever configuration properties for pool management. For example:

retrievers:
  - kind: postgresql
    uri: "postgres://user:pass@host/db"
    table: "go_feature_flag"
    pool:
      max_open_conns: 50
      max_idle_conns: 10
      conn_max_lifetime: "30m"
      conn_max_idle_time: "10m"

Metadata

Metadata

Assignees

No one assigned

    Labels

    changeThis is a change in the code that should not affect the userspriority:P2Medium priority

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions