Re: problem permission on view

Поиск
Список
Период
Сортировка
От Andreas Pflug
Тема Re: problem permission on view
Дата
Msg-id 414B5FD3.7090001@pse-consulting.de
обсуждение исходный текст
Ответ на Re: problem permission on view  (Gaetano Mendola <mendola@bigfoot.com>)
Ответы Re: problem permission on view  (Gaetano Mendola <mendola@bigfoot.com>)
Список pgsql-hackers
Gaetano Mendola wrote:

> I'd like to fix this by myself but for lack of time and lack of postgres
> code knowledge I'm stuck.

What you want is
CREATE VIEW foo AS  SELECT p1, p2, bar('theValidParameter') as p3  FROM othertab;
GRANT ALL ON TABLE foo TO public;

and don't want to grant execute on bar() to public.

What you could do is creating an intermediate function like this:

CREATE FUNCTION interfoo() RETURNS SETOF record AS
$q$  SELECT p1, p2, bar('theValidParameter') as p3  FROM othertab;
$q$ LANGUAGE SQL SECURITY DEFINER;
GRANT EXECUTE ON FUNCTION interfoo() TO public;

CREATE VIEW foo AS  SELECT f.p1, f.p2, f.p3 FROM interfoo() f(a text, b text, c text);
GRANT ALL ON TABLE foo TO public;

Regards,
Andreas


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: R-Tree operators
Следующее
От: Peter Eisentraut
Дата:
Сообщение: New config.guess and config.sub