Well, a view is the easiest thing, grant permissions to the view and
revoke them from the base table.

However, if you actually want functions, you should be able to say
something like:

create table testtable(a text, b int);
create function gettesttable() returns setof testtable as ' select * from
testtable where a = SESSION_USER;' language 'SQL' security definer;

This example is one that really would make more sense as a view, but
imagine that the function was plpgsql and actually did something
interesting.

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é