Re: 9.5 Create Function Set From Current taken at creation time?

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: 9.5 Create Function Set From Current taken at creation time?
Date: 2016-08-09 13:10:04
Message-ID: 8cee0868-4d5c-beab-ea5d-82b8158d6e6b@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2016-08-09 13:27:42 Re: 9.5 Create Function Set From Current taken at creation time?
Previous Message David G. Johnston 2016-08-08 21:46:33 9.5 Create Function Set From Current taken at creation time?