From 3b3b5a366371737434c633f8e6b473b00f324957 Mon Sep 17 00:00:00 2001 From: NagIzaazShaik <176337212+shaikn6@users.noreply.github.com> Date: Fri, 28 Aug 2026 01:25:52 -0400 Subject: [PATCH] docs(pgxpool): correct the documented pool_max_conns default ParseConfig's doc lists 'pool_max_conns: ... (default 4)', but when the parameter is unset the code sets MaxConns to the greater of 4 and runtime.NumCPU() (pool.go, the else branch a few lines below). On any host with more than 4 CPUs the effective default is NumCPU, not 4. The Config.MaxConns field doc already states it correctly; this aligns the ParseConfig list with it. --- pgxpool/pool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgxpool/pool.go b/pgxpool/pool.go index 8b71c88a2..bcf7bfef1 100644 --- a/pgxpool/pool.go +++ b/pgxpool/pool.go @@ -343,7 +343,7 @@ func NewWithConfig(ctx context.Context, config *Config) (*Pool, error) { // ParseConfig builds a Config from connString. It parses connString with the same behavior as [pgx.ParseConfig] with the // addition of the following variables: // -// - pool_max_conns: integer greater than 0 (default 4) +// - pool_max_conns: integer greater than 0 (default is the greater of 4 or runtime.NumCPU()) // - pool_min_conns: integer 0 or greater (default 0) // - pool_min_idle_conns: integer 0 or greater (default 0) // - pool_max_conn_lifetime: duration string (default 1 hour)