How do I make this function work? I am trying to get all the rolnamesfrom pg_roles.
CREATE OR REPLACE FUNCTION test() SETOF name AS $$DECLARErrol name;BEGINSELECT rolname INTO rrol FROM pg_roles;RETURN setof rrol;END;$$ LANGUAGE plpgsql;
regards,