Just use REVOKE
to control the permissions Postgres assigns to roles.
Documentation:
The
REVOKE
command revokes previously granted privileges from one or more roles. The key wordPUBLIC
refers to the implicitly defined group of all roles.See the description of the
GRANT
command for the meaning of the privilege types.
CREATE FUNCTION nocando()
RETURNS void AS $$
SELECT null::void
$$ LANGUAGE sql;
REVOKE ALL
ON FUNCTION nocando ()
FROM PUBLIC ;