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 1ne8ln-0005u4-Fh for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 05:08:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ne8lm-0000Qe-B8 for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 05:08: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 1ne8lm-0000QV-0I for pgsql-hackers@lists.postgresql.org; Tue, 12 Apr 2022 05:08:50 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ne8lf-0000vr-Sy for pgsql-hackers@lists.postgresql.org; Tue, 12 Apr 2022 05:08:49 +0000 Received: by mail-pf1-x42c.google.com with SMTP id y8so11328642pfw.0 for ; Mon, 11 Apr 2022 22:08:43 -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=PuLN2oV+qcYPw4Qf1RJ5kqJ6o9FRQgaWPcoIe/nltrY=; b=JeVoaEjwAhqOnjru8RTrsunS4mxrIGUR52jV1YsAaFI3eisByTkVftlgKaJGXaTxQi oICZQtBvkCTlWwSSEtB8FYvao3KAqckMz4qVwwOlkhCe/75D6UjZI//sz0tVKzxfTd56 WDCUGHPk2e+Q4kiaqBICCFtPnew61hDBTCEDhLeZHNCaFQHnr4GXiuxMHKylpM9QhzDg fF5IxUVIvS7OO6WJmEM6BMWuiHyY9BwJaqZX6XFmA9fho7gTxX7BjA5vIELNvlwxUtDc PvyqVeqnvXS9VuKu/q9nsb7VQ1aKpwYRjS9wBnxAxXjw7v5MX/WCbX/G7Ef68h4M3DS7 rbNA== 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=PuLN2oV+qcYPw4Qf1RJ5kqJ6o9FRQgaWPcoIe/nltrY=; b=uvWt90iLjyhQZSzsCmFoyQN+//vKAtPaxmFjy5Jw+ITEeNU89UuuniMH2IVtfUsc2g EUfx/CrhuLxMNDsp0xmwy0G4AHncmvHjW77Oxe6TYsrEUWW08THGFb5MEBHh6SGZ13BY Msz5iejBjpievzaJMIReE0btCdVcsKHNcrY4mpV1AhuKZABCcuZcYITJE5qcUjczwxSE F2m5GXczAsDR2TdA2WKe04xTzopOtSxxgpJtIJ82VSG8vpLkMaVnLD2+CDoAV2MBSoXj ba+FqMaYhZIHCpSlNpIkCFfuU8j2F7Kn2awwmPES/JXehtf2K1UQ/r3MQtAqMUI4/X/V 6fzw== X-Gm-Message-State: AOAM532r0GJtvXvv4lPALFCVMVh4DlpEPEzawD36k2LDhybRe26vFmEu KPTXStZ8jcOmkaHh1aZOIno= X-Google-Smtp-Source: ABdhPJwrBjGKoG5F+4HLQ6yEbOIXnx9Pyd2tGA4EKkNRf3QueeNZEZBHRunTwwG2XiOU1Ww5Q2CTBg== X-Received: by 2002:a05:6a00:2392:b0:4fa:dcd2:5bc1 with SMTP id f18-20020a056a00239200b004fadcd25bc1mr36070180pfc.8.1649740121488; Mon, 11 Apr 2022 22:08:41 -0700 (PDT) Received: from jrouhaud (2001-b011-1005-f552-4db2-857c-d861-75db.dynamic-ip6.hinet.net. [2001:b011:1005:f552:4db2:857c:d861:75db]) by smtp.gmail.com with ESMTPSA id 16-20020a17090a005000b001c7511dc31esm1149598pjb.41.2022.04.11.22.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 22:08:40 -0700 (PDT) Date: Tue, 12 Apr 2022 13:08:35 +0800 From: Julien Rouhaud To: Nathan Bossart Cc: Robert Haas , 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: References: <20220326072203.asge6bua7dxczf7m@jrouhaud> <20220326172316.obspcdmjqerislri@alap3.anarazel.de> <20220330163051.GA784643@nathanxps13> <20220411164408.GA1915258@nathanxps13> <20220411204442.GA2004824@nathanxps13> <20220411211435.GA2057981@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220411211435.GA2057981@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Mon, Apr 11, 2022 at 02:14:35PM -0700, Nathan Bossart wrote: > On Mon, Apr 11, 2022 at 01:44:42PM -0700, Nathan Bossart wrote: > > On Mon, Apr 11, 2022 at 04:36:36PM -0400, Robert Haas wrote: > >> 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. > > Here's a new patch set. I've only changed 0003 as described above. My > apologies for the unnecessary round trip. It looks sensible to me, although I think I would apply 0003 before 0002. + if (process_shared_preload_libraries_in_progress && + !allow_when_loading_preload_libs) + ereport(ERROR, + (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), + errmsg("cannot change parameters while loading " + "\"shared_preload_libraries\""))); + I think the error message should mention at least which GUC is being modified.