I've run these statements on Postgres CLI (I'm using PostgreSQL v13.1):
CREATE ROLE blog_user;
GRANT blog_user TO current_user;
And I created a function
CREATE FUNCTION SIGNUP(username TEXT, email TEXT, password TEXT)
RETURNS jwt_token AS
$$
DECLARE
token_information jwt_token;
BEGIN
....
END;
$$ LANGUAGE PLPGSQL VOLATILE SECURITY DEFINER;
Finally I granted a permission:
GRANT EXECUTE ON FUNCTION SIGNUP(username TEXT, email TEXT, password TEXT) TO anonymous;
I wish to list all grants per user/role in my schema/database. \du
and \du+
show basic information, which does not contain info about the grant (execute on function) made recently.
Best Answer
While the following is not a complete solution (column privs aren't included, it doesn't have the function signatures) you should hopefully be able to get most of what you're asking for using: