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

From David G. Johnston
Subject 9.5 Create Function Set From Current taken at creation time?
Date
Msg-id CAKFQuwa=PBrKeXKv1kukEY81J6LkVHo7yRE6yM+FO6Dv+4stcQ@mail.gmail.com
Whole thread Raw
Responses Re: 9.5 Create Function Set From Current taken at creation time?  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-bugs
Reading this:

"""
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.
"""


I expect the attached script to output "NOTICE: SP : thirdschema", instead it outputs "NOTICE: SP: otherschema"

Either the wording in the docs is poor or this is broken.  If the former it would help to provide an example in said docs as to when one would wish to use "FROM CURRENT" to clarify its intended use.

As I presently read it I get to SET LOCAL search_path within my function without any concern about affecting the caller's execution environment.  Simply inheriting the caller's search_path and then making changes in-function will result in those changes remaining.

Thanks!

David J.

P.S. I have the EXECUTE in their since that was original need and thought maybe it was a contributing factor...

Attachment

pgsql-bugs by date:

Previous
From: Gerardo Herzig
Date:
Subject: Re: [PERFORM] Create language plperlu Error
Next
From: Peter Eisentraut
Date:
Subject: Re: 9.5 Create Function Set From Current taken at creation time?