Limited utility in RECURSIVE VIEWS?
A recursive view is just syntactic sugar for a recursive CTE.

create or replace recursive view foo (name, groupid, parentid) as 
  select name, groupid,parentid from rl.groups where groupid=2
  union
  SELECT groups.name, groups.groupid, groups.parentid 
    FROM rl.groups AS groups, foo                       
    WHERE groups.groupid = foo.parentid ;


is the same as your CTE.

If you want to parameterize a CTE, wrap it in a function.