Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ey7ca-0008Ly-6b for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Mar 2018 03:07:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ey7cY-0000Cy-TF for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Mar 2018 03:07:30 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ey7cY-0000Co-Iq for pgsql-hackers@lists.postgresql.org; Tue, 20 Mar 2018 03:07:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ey7cR-00011F-FQ for pgsql-hackers@postgresql.org; Tue, 20 Mar 2018 03:07:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w2K37DO6010038; Mon, 19 Mar 2018 23:07:13 -0400 From: Tom Lane To: Michael Paquier cc: Kyotaro HORIGUCHI , pavel.stehule@gmail.com, a.zakirov@postgrespro.ru, pgsql-hackers@postgresql.org Subject: Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs In-reply-to: <20180320003951.GA4963@paquier.xyz> References: <20180316.173433.146279605.horiguchi.kyotaro@lab.ntt.co.jp> <20180316121554.GA2552@paquier.xyz> <20180319.144909.253960140.horiguchi.kyotaro@lab.ntt.co.jp> <2637.1521501336@sss.pgh.pa.us> <20180320003951.GA4963@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Tue, 20 Mar 2018 09:39:51 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10036.1521515233.1@sss.pgh.pa.us> Date: Mon, 19 Mar 2018 23:07:13 -0400 Message-ID: <10037.1521515233@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Mon, Mar 19, 2018 at 07:15:36PM -0400, Tom Lane wrote: >> This is a good thing not least because all the GUC_LIST_QUOTE variables >> are in core. I've been trying to think of a way that we could have >> correct behavior for variables that the core backend doesn't know about >> and whose extension shlibs aren't currently loaded, and I can't come up >> with one. So I think that in practice, we have to document that >> GUC_LIST_QUOTE is unsupported for extension variables > I would propose to add a sentence on the matter at the bottom of the > CREATE FUNCTION page. Even with that, the handling of items in the list > is incorrect with any patches on this thread: the double quotes should > be applied to each element of the list, not the whole list. No, because all the places we are worried about are interpreting the contents of proconfig or setconfig columns, and we know that that info has been through flatten_set_variable_args(). If that function thought that GUC_LIST_QUOTE was applicable, it already did the appropriate quoting, and we can't quote over that without making a mess. But if it did not think that GUC_LIST_QUOTE was applicable, then its output can just be treated as a single string, and that will work fine. Our problem basically is that if we don't know the variable that was being processed, we can't be sure whether GUC_LIST_QUOTE was used. I don't currently see a solution to that other than insisting that GUC_LIST_QUOTE only be used for known core GUCs. regards, tom lane