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 1eoA8H-0003jf-DO for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Feb 2018 15:47:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eoA8G-0007XQ-HS for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Feb 2018 15:47:04 +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.84_2) (envelope-from ) id 1eoA8G-0007XG-2q for pgsql-hackers@lists.postgresql.org; Tue, 20 Feb 2018 15:47:04 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eoA8C-0007jV-S1 for pgsql-hackers@postgresql.org; Tue, 20 Feb 2018 15:47:02 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id BD94E21C24C9; Tue, 20 Feb 2018 18:46:58 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from zakirov.localdomain (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 915CA21C2478; Tue, 20 Feb 2018 18:46:58 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1519141618; bh=v3jSR5R8C798a1DGS1QGJidR80ajAbdeMRwOvOC/Wno=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=IVbCQiKPGFa2Oarg8VaJDg1VRRdh9vVNgRlRJ8eoiuC80WxBFea9vp+sBHzON0nTz NXD7boUeqwVEEnhNSZl4bDYUYCLLeqNY9sVekkPEXA0CgAmBGLTufF1WgmMjVjGVUA xR58m+KZSF4EgIGX9jwDDtZQUrVgj2l4gyewHcQk= Date: Tue, 20 Feb 2018 18:46:57 +0300 From: Arthur Zakirov To: Michael Paquier Cc: Tom Lane , Postgres hackers Subject: Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs Message-ID: <20180220154656.GA7518@zakirov.localdomain> References: <20180111064900.GA51030@paquier.xyz> <13647.1515685358@sss.pgh.pa.us> <20180112012440.GA2222@paquier.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180112012440.GA2222@paquier.xyz> User-Agent: Mutt/1.9.3 (2018-01-21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, On Fri, Jan 12, 2018 at 10:24:40AM +0900, Michael Paquier wrote: > OK, I can live with that. What do you think about the attached? I'll be > happy to produce patches for back-branches as necessary. When an option > is not found, I have made the function return 0 as value for the flags, > which is consistent with flatten_set_variable_args(). To make things > behave more consistently with GUC_LIST_QUOTE GUCs, it seems to me that > those should not be quoted as well (ALTER SYSTEM shares the same > compatibility). And attached is a patch. Just 2 cents from me. It seems that there is a problem with extensions GUCs. For example: =# CREATE FUNCTION func_with_set_params() RETURNS integer AS 'select 1;' LANGUAGE SQL set plpgsql.extra_errors to 'shadowed_variables'; =# SELECT pg_get_functiondef('func_with_set_params'::regproc); pg_get_functiondef ---------------------------------------------------------- CREATE OR REPLACE FUNCTION public.func_with_set_params()+ RETURNS integer + LANGUAGE sql + SET "plpgsql.extra_errors" TO 'shadowed_variables' + AS $function$select 1;$function$ + It is good while plpgsql is loaded. But when we exit the session and try it again in another: =# SELECT pg_get_functiondef('func_with_set_params'::regproc); ERROR: unrecognized configuration parameter "plpgsql.extra_errors" -- Arthur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company