Re: 9.5 Create Function Set From Current taken at creation time? - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: 9.5 Create Function Set From Current taken at creation time?
Date
Msg-id 8cee0868-4d5c-beab-ea5d-82b8158d6e6b@2ndquadrant.com
Whole thread Raw
In response to 9.5 Create Function Set From Current taken at creation time?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: 9.5 Create Function Set From Current taken at creation time?
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: 9.5 Create Function Set From Current taken at creation time?
Next
From: "David G. Johnston"
Date:
Subject: Re: 9.5 Create Function Set From Current taken at creation time?