On 8/8/16 5:46 PM, David G. Johnston wrote:
> """
> 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.
> """
>
> https://www.postgresql.org/docs/current/static/sql-createfunction.html
>
> I expect the attached script to output "NOTICE: SP : thirdschema",
> instead it outputs "NOTICE: SP: otherschema"
I think the piece you are missing is that it saves the setting when the
function is created, not when it is run.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services