I have a table t
and some functions which access t
. For example:
create function list_t() returns setof t as $$
select * from t;
$$ language sql stable;
Is it possible to define role permissions to only allow the execution of list_t()
, while not allowing plain SELECT
, UPDATE
, DELETE
and INSERT
queries on t
?
I tried the following:
grant execute on all functions in schema public to my_user;
revoke all on t from my_user;
While this indeed disallows SELECT * FROM t
, it also disallows SELECT list_t()
.