pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
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
Date: Fri, 02 Dec 2011 01:27:14 -0500
Message-ID: <7517.1322807234@sss.pgh.pa.us> (raw)
In-Reply-To: <E1RWMUx-0007Gn-C9@wrigleys.postgresql.org>
References: <E1RWMUx-0007Gn-C9@wrigleys.postgresql.org>

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



view thread (3+ messages)  latest in thread

Message-ID: <7517.1322807234@sss.pgh.pa.us>
Permalink:  ../7517.1322807234@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7517.1322807234@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, postgresql@thewickedtribe.net
  Subject: Re: BUG #6316: function search_path causes set_config() is_local = true to have no effect
  In-Reply-To: <7517.1322807234@sss.pgh.pa.us>
  References: <E1RWMUx-0007Gn-C9@wrigleys.postgresql.org> <7517.1322807234@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox