Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WcDT6-00051x-FV for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Apr 2014 12:37:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WcDT5-0004Vc-AO for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Apr 2014 12:37:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wbacz-0004G5-1e for pgsql-hackers@postgresql.org; Sat, 19 Apr 2014 19:08:41 +0000 Received: from mail.atikon.at ([81.19.152.34]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wbacv-0006ck-Hs for pgsql-hackers@postgresql.org; Sat, 19 Apr 2014 19:08:40 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.atikon.at (Postfix) with ESMTP id 6ECFB105A74; Sat, 19 Apr 2014 21:08:35 +0200 (CEST) X-Virus-Scanned: amavisd-new at atikon.com Received: from mail.atikon.at ([81.19.152.34]) by localhost (smithers.atikon.at [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 145FjkUNZO95; Sat, 19 Apr 2014 21:08:30 +0200 (CEST) Received: from sphinx.localnet (cm249-156.liwest.at [81.10.249.156]) (Authenticated sender: nine@atikon.com) by mail.atikon.at (Postfix) with ESMTPSA id E5D60105A71; Sat, 19 Apr 2014 21:08:30 +0200 (CEST) From: Stefan Seifert To: Tom Lane Cc: Bruce Momjian , PostgreSQL-development Subject: Re: Re: [DOCS] Docs incorrectly claiming equivalence between show and pg_settings Date: Sat, 19 Apr 2014 21:08:30 +0200 Message-ID: <1674217.XTI7CnVsO0@sphinx> User-Agent: KMail/4.12.4 (Linux/3.14.0-2.ge60ddcf-desktop+; KDE/4.12.4; x86_64; ; ) In-Reply-To: <9741.1397929096@sss.pgh.pa.us> References: <6963016.0JgteVRq9S@sunshine.detonation.org> <20140419171257.GA3653@momjian.us> <9741.1397929096@sss.pgh.pa.us> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Saturday 19 April 2014 13:38:16 Tom Lane wrote: > > 3 document this restriction > > As for (3), I might be wrong, but I don't think the documentation mentions > the possibility of abusing SET this way at all. Restrictions in > undocumented quasi-features are likewise undocumented. http://www.postgresql.org/docs/devel/static/runtime-config-custom.html states: "Because custom options may need to be set in processes that have not loaded the relevant extension module, PostgreSQL will accept a setting for any two-part parameter name." So I'd say the possibility of using SET this way is somewha documented. That's at least how I actually got the idea of doing that. Maybe it can help if I describe our use case: we have some plperlu stored procedures and triggers that use them that replicate specific data from our internal management application's database to the system on our webserver. When running the application's test suite though we obviously don't want that and instead want it to replicate to another local database, so we can test the triggers as well. We use a custom option set by our test suite to communicate the required change in replication target to the stored procedure. As a nice side effect we can use the same mechanism to prevent a test sandbox version of the application from trying to replicate to the webserver. So far this works quite well except for the SHOW command throwing an exception when we request an unknown configuration parameter complicating our stored procedure a little. It would be more comfortable if we could query pg_settings and just get an empty result if the configuration parameter is not set. Regards, Stefan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers