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 1ne0u2-0004zy-Kw for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Apr 2022 20:44:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ne0u1-0002Wu-7u for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Apr 2022 20:44:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ne0u0-0002Wl-Sa for pgsql-hackers@lists.postgresql.org; Mon, 11 Apr 2022 20:44:48 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ne0ty-0005cH-Gi for pgsql-hackers@lists.postgresql.org; Mon, 11 Apr 2022 20:44:47 +0000 Received: by mail-pg1-x529.google.com with SMTP id c2so15193027pga.10 for ; Mon, 11 Apr 2022 13:44:46 -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:in-reply-to; bh=orpqAnlL6XE7kbZJak6Pkg5JnikojlPDFifuXEsDDfg=; b=FDzMgBpAjIRGnFmHvRvF0D5h7EPRHQkO0BYbpUV3agzUtKbbSt5OC05LHKheEqtiiQ 0wRbf+HlNwaXxDJSPsMrKoYzTXl31yBoBdX+etTWIOC+bao2FptadSq4+L2jpMT5RGhJ N8jwdAsttNfGsZDGS/2+UbG6U+55yuQF79Gq0BomOnRz3dYIBtNUFqIngGhibOS8lMzA mW+puRUOrHqja6LBFeMthqvT8PyyryCWmTK1MbY6n2BOXcK/cqtYXdc2ULKdP+XxFGd1 cWRZ6B8wEcFbBSB4yRNvLPTNFpaAg5knwaCNziBv///Fe8l9kjnhEBFTBimgy5oH148n Atbw== 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:in-reply-to; bh=orpqAnlL6XE7kbZJak6Pkg5JnikojlPDFifuXEsDDfg=; b=TmTveKJrzoJhFJ2FDY9QdqLYPhjbuClo/KzbwYeT7ckBt7Vnvzn9J1ekKYS0Qj/Kf7 sfChl+mCqVZL1XYpSHMvF0SuMDOZM1Rxyj1Yp8mgLYxmKvNuxuJI8HlRhpxwqZ/y5Pp6 KqW428Ebo8AlnWEAVNvUXbgxfclS3FuRTB7BCO28ZYdU0pPfV/B9xgYu/sFhcDEOtkii nZj8sUHea/klYIwprU45dsMewc2JdB9ITF6eEJrVwqG1amJ9z3ON2x+eT5Zhf4Sppk8Z xbKoMCXNhvaSYw89+JI9epdMxAUash5fcIPw/d4OmI3Q+xedyMYnkEgLxF0KJu4oCRLQ m+kA== X-Gm-Message-State: AOAM530mkRfpYrMKzfsNH3GUlTQJMhkgeZTz8KVNqoE6F0BstnViiwEd OHUOUbDZGauWYFZXoj3yAlc= X-Google-Smtp-Source: ABdhPJxBSD/0cS6y2MqmbkpMNxhYwY6gSO89RwYmaZioNaC/0LO5YrXlITPSp47hOr+Ljh+T4M+Chg== X-Received: by 2002:a05:6a00:23c2:b0:4fa:e12e:91cd with SMTP id g2-20020a056a0023c200b004fae12e91cdmr34595462pfc.37.1649709885167; Mon, 11 Apr 2022 13:44:45 -0700 (PDT) Received: from nathanxps13 ([50.54.155.70]) by smtp.gmail.com with ESMTPSA id s16-20020a056a001c5000b00505688553e1sm15200266pfw.57.2022.04.11.13.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 13:44:44 -0700 (PDT) Date: Mon, 11 Apr 2022 13:44:42 -0700 From: Nathan Bossart To: Robert Haas Cc: Julien Rouhaud , Andres Freund , Michael Paquier , "Bossart, Nathan" , Fujii Masao , "wangsh.fnst@fujitsu.com" , Bharath Rupireddy , Greg Sabino Mullane , Tom Lane , "pgsql-hackers@lists.postgresql.org" Subject: Re: make MaxBackends available in _PG_init Message-ID: <20220411204442.GA2004824@nathanxps13> References: <20220325063542.n6die7fmawluqkfp@jrouhaud> <20220325222317.dftrmzuyrb3iv62o@alap3.anarazel.de> <20220326072203.asge6bua7dxczf7m@jrouhaud> <20220326172316.obspcdmjqerislri@alap3.anarazel.de> <20220330163051.GA784643@nathanxps13> <20220411164408.GA1915258@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Apr 11, 2022 at 04:36:36PM -0400, Robert Haas wrote: > On Mon, Apr 11, 2022 at 12:44 PM Nathan Bossart > wrote: >> Here are some patches. 0001 reverts all the recent commits in this area, >> 0002 is the patch I posted in August, and 0003 is an attempt at blocking >> GUC changes in preloaded libraries' _PG_init() functions. > > If we throw an error while defining_custom_guc is true, how will it > ever again become false? Ah, I knew I was forgetting something this morning. It won't, but the only place it is presently needed is when loading shared_preload_libraries, so I believe startup will fail anyway. However, I can see defining_custom_guc being used elsewhere, so that is probably not good enough. Another approach could be to add a static set_config_option_internal() function with a boolean argument to indicate whether it is being used while defining a custom GUC. I'll adjust 0003 with that approach unless a better idea prevails. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com