postgres: add user function stat tracking