Re: Function and Tables Privilege
От | Iande |
---|---|
Тема | Re: Function and Tables Privilege |
Дата | |
Msg-id | E19krTD-0006uX-EM@mail5.br.inter.net обсуждение исходный текст |
Ответ на | Function and Tables Privilege (Iande <iande@br.inter.net>) |
Список | pgsql-novice |
Well, a view is the easiest thing, grant permissions to the view andrevoke them from the base table.However, if you actually want functions, you should be able to saysomething like:create table testtable(a text, b int);create function gettesttable() returns setof testtable as ' select * fromtesttable where a = SESSION_USER;' language 'SQL' security definer;This example is one that really would make more sense as a view, butimagine that the function was plpgsql and actually did somethinginteresting.What have you tried so far?---------------------- What I was thinking, would be something on the line of enable privilege at the begining of the function and disable privilege and the end to restore the currente_user privileges, from wot i understand, this way the function would execute with it´s onwer´s privileges. would it not be advisable not to use a view?.. i want to insert into a table via a function, so that, i can only access the especific table through the functions parameters. is this any clear? thanks once again Iandé
В списке pgsql-novice по дате отправления: