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 1neNCy-0000Fx-8H for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 20:33:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1neNCw-0008M2-21 for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 20:33:50 +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 1neNCv-0008L5-Of for pgsql-hackers@lists.postgresql.org; Tue, 12 Apr 2022 20:33:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neNCt-0000bq-I1 for pgsql-hackers@lists.postgresql.org; Tue, 12 Apr 2022 20:33:49 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 23CKXdCb915772; Tue, 12 Apr 2022 16:33:39 -0400 From: Tom Lane To: Nathan Bossart 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 In-reply-to: <20220412194938.GA2064338@nathanxps13> References: <20220330163051.GA784643@nathanxps13> <20220411164408.GA1915258@nathanxps13> <20220411204442.GA2004824@nathanxps13> <20220411211435.GA2057981@nathanxps13> <20220412174427.sngj2uexzsttazs2@alap3.anarazel.de> <20220412180306.GA2063516@nathanxps13> <20220412194938.GA2064338@nathanxps13> Comments: In-reply-to Nathan Bossart message dated "Tue, 12 Apr 2022 12:49:38 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <915770.1649795619.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 12 Apr 2022 16:33:39 -0400 Message-ID: <915771.1649795619@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. regards, tom lane