Re: search_path vs extensions

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: search_path vs extensions
Дата
Msg-id 4136ffa0905291653v76a9425di89a7d73cf7c43e0d@mail.gmail.com
обсуждение исходный текст
Ответ на Re: search_path vs extensions  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: search_path vs extensions  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Fri, May 29, 2009 at 11:18 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>
> Good point.  But maybe there's some way of getting some kind of
> behavior that is closer to lexical scoping/early binding?  Because the
> way it works right now has lousy security implications, beyond being
> difficult for search_path management.  Assign a search path to a
> schema, that applies to views and functions defined therein?
> *brainstorming*

Well we already set search_path locally in SECURITY DEFINER functions.
Normal functions run with the credentials of the caller so that's not
an issue.

But if a SECURITY DEFINER function calls another function that other
function will inherit the credentials of the caller so it must inherit
the search path of the caller as well. So that has to be dynamically
scoped.

I'm beginning to understand why Oracle programmers are accustomed to
setting SECURITY DEFINER everywhere. I think Oracle also knows to
treat such code as lexically scoped and can bind references when
loading such code.

--
greg


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

Предыдущее
От: James Pye
Дата:
Сообщение: Re: Python 3.0 does not work with PL/Python
Следующее
От: Greg Stark
Дата:
Сообщение: Re: search_path improvements WAS: search_path vs extensions