9.5 Create Function Set From Current taken at creation time?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема 9.5 Create Function Set From Current taken at creation time?
Дата
Msg-id CAKFQuwa=PBrKeXKv1kukEY81J6LkVHo7yRE6yM+FO6Dv+4stcQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: 9.5 Create Function Set From Current taken at creation time?  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список 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...

Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Gerardo Herzig
Дата:
Сообщение: Re: [PERFORM] Create language plperlu Error
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: 9.5 Create Function Set From Current taken at creation time?