 /*
 remaining:
   config 2
-  recursive 4
+  recursive 2
   search 2
   status 1
   learn 3


-- TODO Search across entity types

-- TODO recursive List all units of a subject, recursively

-- TODO recursive List all subjects unit belongs to, recursively

-- Select the most popular subjects
create function sg_public.select_popular_subjects()

grant execute on function sg_public.select_my_units()
  to sg_anonymous, sg_user, sg_admin;
grant execute on function sg_public.select_my_subjects()
  to sg_anonymous, sg_user, sg_admin;

grant execute on function sg_public.select_units_by_subject(uuid)
  to sg_anonymous, sg_user, sg_admin;
grant execute on function sg_public.select_subjects_by_unit(uuid)
  to sg_anonymous, sg_user, sg_admin;


