I want to revoke execute from app.my_function
function, so users with role doctor can't call it, I can't figure out what wrong with my code, I spend the whole day trying to find a solution.
CREATE SCHEMA app;
CREATE ROLE doctor;
GRANT USAGE ON SCHEMA app TO doctor;
CREATE FUNCTION app.my_function() AS $$ ... $$ LANGUAGE SQL;
REVOKE ALL ON FUNCTION app.my_function() FROM doctor;