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 1mzwOZ-0001ET-Eq for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Dec 2021 07:50:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mzwOY-0001g3-1i for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Dec 2021 07:50:42 +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 1mzwOX-0001dB-Od for pgsql-hackers@lists.postgresql.org; Wed, 22 Dec 2021 07:50:41 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzwOU-0005Uc-FR for pgsql-hackers@postgresql.org; Wed, 22 Dec 2021 07:50:40 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 6362860833; Wed, 22 Dec 2021 16:50:34 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.4 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 22 Dec 2021 16:50:34 +0900 From: Shinya Kato To: Tom Lane , Kyotaro Horiguchi Cc: peter.eisentraut@enterprisedb.com, masao.fujii@oss.nttdata.com, bharath.rupireddyforpostgres@gmail.com, daniel@yesql.se, pgsql-hackers@postgresql.org Subject: Re: Emit a warning if the extension's GUC is set incorrectly In-Reply-To: <57009.1640107405@sss.pgh.pa.us> References: <9f5e96ca44891915f1d2736bea9fdf45@oss.nttdata.com> <83b33009-3a1b-9230-8f07-2115763c1853@enterprisedb.com> <20211221.100834.1297468238807011575.horikyota.ntt@gmail.com> <57009.1640107405@sss.pgh.pa.us> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: Shinya11.Kato@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-12-22 02:23, Tom Lane wrote: > Kyotaro Horiguchi writes: >> At Mon, 20 Dec 2021 21:05:23 +0900, Shinya Kato >> wrote in >>> We should use EmitWarningsOnPlaceholders when we use >>> DefineCustomXXXVariable. >>> I don't think there is any room for debate. > >> Unfortunately, pltcl.c defines variables both in pltcl and pltclu but >> the patch adds the warning only for pltclu. > > Right. The rest of 0001 looks fine, so pushed with that correction. > > I concur that 0002 is unacceptable. The result of it will be that > a freshly-loaded extension will fail to hook into the system as it > should, because it will fail to complete its initialization. > That will cause user frustration and bug reports. > > (BTW, I wonder if EmitWarningsOnPlaceholders should be using LOG > rather than WARNING when it's running in the postmaster. Use of > WARNING is moderately likely to result in nothing getting printed > at all.) > > 0003 looks to me like it was superseded by 75d22069e. I do not > particularly like that patch though; it seems both inefficient > and ill-designed. 0003 is adding a check in an equally bizarre > place. Why isn't add_placeholder_variable the place to deal > with this? Also, once we know that a prefix is reserved, > why don't we throw an error not just a warning for attempts to > set some unknown variable under that prefix? We don't allow > you to set unknown non-prefixed variables. > > regards, tom lane Thank you for pushing! Thank you all for the reviews, I think I will take down 0002 and 0003. -- Regards, -- Shinya Kato Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION