Re: BUG #6316: function search_path causes set_config() is_local = true to have no effect - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6316: function search_path causes set_config() is_local = true to have no effect
Date
Msg-id 7517.1322807234@sss.pgh.pa.us
Whole thread Raw
In response to BUG #6316: function search_path causes set_config() is_local = true to have no effect  (postgresql@thewickedtribe.net)
Responses Re: BUG #6316: function search_path causes set_config() is_local = true to have no effect
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: postgresql@thewickedtribe.net
Date:
Subject: BUG #6316: function search_path causes set_config() is_local = true to have no effect
Next
From: Jon Erdman
Date:
Subject: Re: BUG #6316: function search_path causes set_config() is_local = true to have no effect