Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 81989DDBC27 for ; Fri, 2 Dec 2011 02:48:23 -0400 (AST) Received: from ginormica.thewickedtribe.net ([208.81.240.119]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RWMv0-0006QB-5w for pgsql-bugs@postgresql.org; Fri, 02 Dec 2011 06:48:23 +0000 Received: from [192.168.0.100] (cpe-70-113-105-109.austin.res.rr.com [70.113.105.109]) by ginormica.thewickedtribe.net (Postfix) with ESMTPSA id 65EE71FD8; Fri, 2 Dec 2011 00:48:08 -0600 (CST) Message-ID: <4ED874A8.2040904@thewickedtribe.net> Date: Fri, 02 Dec 2011 00:48:08 -0600 From: Jon Erdman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs@postgresql.org, postgresql@thewickedtribe.net Subject: Re: BUG #6316: function search_path causes set_config() is_local = true to have no effect References: <7517.1322807234@sss.pgh.pa.us> In-Reply-To: <7517.1322807234@sss.pgh.pa.us> X-Enigmail-Version: 1.4a1pre OpenPGP: id=9D068521; url=subkeys.pgp.net Content-Type: multipart/mixed; boundary="------------040208020405060408080403" X-Pg-Spam-Score: -3.1 (---) X-Archive-Number: 201112/21 X-Sequence-Number: 31832 This is a multi-part message in MIME format. --------------040208020405060408080403 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 DOH! *facepalm* Thanks Tom! I read docs on set_config() and didn't think to check CREATE FUNCTION. It does make sense, and now that you point it out, I do remember that too. I didn't think to check it because this function is *not* secdef, which is when you'd normally set a search_path on it (a dev accidentally set it on a non-secdef function). Thanks, and apologies for the false alarm. /me slinks away sheepishly... - -- Jon T Erdman (aka StuckMojo) PostgreSQL Zealot On 12/02/2011 12:27 AM, Tom Lane wrote: > 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 -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7YdKgACgkQRAk1+p0GhSFeHwCeJGNfW9VDeJ68EVZ/trLN6PpZ SIsAnRlj/wr3YO+MF1lSeEEP1UzukhDI =ZV2E -----END PGP SIGNATURE----- --------------040208020405060408080403 Content-Type: application/pgp-keys; name="0x9D068521.asc" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0x9D068521.asc" -----BEGIN PGP PUBLIC KEY BLOCK----- mQGiBER2nicRBADLmRD7Ml/4Fw8O08ZA0B7LCks2Amq99EqmVK8bJsSE1Ig9VIrl wiDBwzlepHN4QfXtNCXT4Y4aN2e1rYoxGM8WsC1qHb6AMjUJSynSX4keKnS5JacS ZqyyddL7BU3hBF/XZxJIZNeDD3QNWdcQC2rM9+5WHucgo5E/oREHzsPczwCgrnL6 +xpF+7G6rShJYaIxY8DuN9kEALq3PTosIOTf7w2UrBReGA2Ap4vvjswszmwLhMy6 uH6sVZr5Oc5LYwOTl6M3ioLNRAEZP+CXHHfwpNMr3Wd2r+xQK0qyu5p7gCl3mhaH f8FxBRWUkE+IjATW4rnlDaWKRraHYfVRoiBy/sQZzsABxlSFG8i0+LKbFp4toCYh 7j/oA/9XNboe0raAuR8JGjHt/jcW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