Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neNdZ-0002Ra-7v for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 21:01:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1neNdX-0002Ds-9N for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 21:01:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neNdW-0002Dj-UN for pgsql-hackers@lists.postgresql.org; Tue, 12 Apr 2022 21:01:18 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1neNdU-0000oa-DF for pgsql-hackers@lists.postgresql.org; Tue, 12 Apr 2022 21:01:18 +0000 Received: by mail-pf1-x430.google.com with SMTP id cw11so147853pfb.1 for ; Tue, 12 Apr 2022 14:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=rn3tBqCPJXb61vXZ7IvtCN5eHLJ/rY6weLOMKnhz3MY=; b=SfH5hiv6dN4gy7EX+cDeXTBzBrp5MEgUKkHq336XYfY4ZE4TGZIDU+/Cc12IHfiXMn MCid15aR+VhSO6A7XCClkw8DGVCj/I63fSZ8XbjTLztvxmxL7qZxXXOSSqbcKyEGcGKt hQo629Un9eZ6R/+cX5GNz2bRqfOOvFPqBM9x4T07FCjhP+bputhzNEZBtWj3DAqL95vP MNzZ8o89fZK1PGD+26RI0JYJEie2JUFjsXP+kc65BniOruGuVTrB/9pWbO01Wx8R6Hpw VRPn4p3K3KWYTCHVBoCvf7fe2K7qSouv+5AwmaCCvpTljIhcbQbu186fKRnK6HrueNfK gF4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=rn3tBqCPJXb61vXZ7IvtCN5eHLJ/rY6weLOMKnhz3MY=; b=2sFnQSEzDlQnhhrmhs0qwXKEy0WNUL1Vtdo3L6bCGqCOGkvgTib8jMUFaNd70NiJyQ FkkkjX9zB6br5K5r6fUS+Nw24gdXL9QyobPg7+IBqB2L7xRrVvttYykBMVJ8K4/pqQ8+ Wd15LqgzmtpO/rYmMZYSxA7qTSq5HQJsZ4mT8v+M+/PPSOWicP0+EMCo5AGDBIlCueGW SnuH/s0qmhzYf/NmEKKRKpA0xLHNhTXupeqCIXawF3Khw/efFcZwhninKacJSuvi3m5a IlAipBvG3a6mG5lhEvjY62utlVgQ1hxw6qVr4wvgpfy9q0LspOuc2izM1aKN8RlL3i4y x05g== X-Gm-Message-State: AOAM533TYSysGICI20dAWWP1jGs6fg39l43WleroH+ys8eIjOu+GfN8q HyFLVO0xd6bavjywz0cw1l8= X-Google-Smtp-Source: ABdhPJweCfz04ppLGmVPQR0cU0teXPZtruddI4Pu42pAI3npGpYcU4gcyo+FfRYcOwlrayWP3rpghg== X-Received: by 2002:a63:4564:0:b0:39d:93f7:7959 with SMTP id u36-20020a634564000000b0039d93f77959mr4408529pgk.492.1649797274341; Tue, 12 Apr 2022 14:01:14 -0700 (PDT) Received: from nathanxps13 ([50.54.155.70]) by smtp.gmail.com with ESMTPSA id c9-20020a63a409000000b0039912d50806sm3716437pgf.87.2022.04.12.14.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 14:01:13 -0700 (PDT) Date: Tue, 12 Apr 2022 14:01:12 -0700 From: Nathan Bossart To: Tom Lane Cc: Robert Haas , Andres Freund , Julien Rouhaud , Michael Paquier , "Bossart, Nathan" , Fujii Masao , "wangsh.fnst@fujitsu.com" , Bharath Rupireddy , Greg Sabino Mullane , "pgsql-hackers@lists.postgresql.org" Subject: Re: make MaxBackends available in _PG_init Message-ID: <20220412210112.GA2065815@nathanxps13> References: <20220411164408.GA1915258@nathanxps13> <20220411204442.GA2004824@nathanxps13> <20220411211435.GA2057981@nathanxps13> <20220412174427.sngj2uexzsttazs2@alap3.anarazel.de> <20220412180306.GA2063516@nathanxps13> <20220412194938.GA2064338@nathanxps13> <915771.1649795619@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <915771.1649795619@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Apr 12, 2022 at 04:33:39PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> On Tue, Apr 12, 2022 at 03:12:42PM -0400, Robert Haas wrote: >>> But if there's even one use case where adjusting GUCs at this phase is >>> reasonable, then 0003 isn't really good enough. We need an 0004 that >>> provides a new hook in a place where such changes can safely be made. > >> I think that is doable. IMO it should be ѕomething like _PG_change_GUCs() >> that is called before _PG_init(). The other option is to add a hook called >> after _PG_init() where MaxBackends is available (in which case we likely >> want GetMaxBackends() again). Thoughts? > > I like the second option. Calling into a module before we've called its > _PG_init function is just weird, and will cause no end of confusion. Alright. I think that is basically what Julien recommended a few weeks ago [0]. Besides possibly reintroducing GetMaxBackends(), we might also want to block SetConfigOption() when called in this new hook. [0] https://postgr.es/m/20220325031146.cd23gaak5qlzdy6l%40jrouhaud -- Nathan Bossart Amazon Web Services: https://aws.amazon.com