Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 5BE5DDDBC27 for ; Fri, 2 Dec 2011 02:27:30 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RWMam-0005h0-Hj for pgsql-bugs@postgresql.org; Fri, 02 Dec 2011 06:27:30 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id pB26RFAb007518; Fri, 2 Dec 2011 01:27:15 -0500 (EST) To: postgresql@thewickedtribe.net cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6316: function search_path causes set_config() is_local = true to have no effect In-reply-to: References: Comments: In-reply-to postgresql@thewickedtribe.net message dated "Fri, 02 Dec 2011 06:21:27 +0000" Date: Fri, 02 Dec 2011 01:27:14 -0500 Message-ID: <7517.1322807234@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -3.1 (---) X-Archive-Number: 201112/20 X-Sequence-Number: 31831 postgresql@thewickedtribe.net writes: > So, found this in 8.3 but tested and it effects everything up to 9.1.1. If > search_path on a function is set to anything, calls to set_config() with > is_local = true inside that function have no effect. Isn't that exactly what the CREATE FUNCTION reference page says? The SET clause causes the specified configuration parameter to be set to the specified value when the function is entered, and then restored to its prior value when the function exits. SET FROM CURRENT saves the session's current value of the parameter as the value to be applied when the function is entered. If a SET clause is attached to a function, then the effects of a SET LOCAL command executed inside the function for the same variable are restricted to the function: the configuration parameter's prior value is still restored at function exit. However, an ordinary SET command (without LOCAL) overrides the SET clause, much as it would do for a previous SET LOCAL command: the effects of such a command will persist after function exit, unless the current transaction is rolled back. regards, tom lane