Thanks Dan and Don, you're the best (but you already know that😉!
I'm running beta4 and with the changes outlined by Dan it's working like a charm.
Don, since IOU I'll promise to take on your request and do my best to test the modules and rewrite queries as long as it's within my capability of doing so...I will keep y'all informed. Thanks again for your quick replies.
acspg=# select ug.group_id as subgroup_id,
acspg-# group_name as subgroup_name,
acspg-# ug.registration_date,
acspg-# ug.approved_p, count(user_id) as n_members,
acspg-# upper(group_name) as u_gname
acspg-# from user_groups ug, user_group_map ugm
acspg-# where parent_group_id=1
acspg-# and ug.group_id=ugm.group_id
acspg-# group by ug.group_id, group_name, ug.registration_date, ug.approved_p
acspg-# union
acspg-# select ug.group_id as subgroup_id,
acspg-# group_name as subgroup_name, ug.registration_date,
acspg-# ug.approved_p, 0 as n_members,
acspg-# upper(group_name) as u_gname
acspg-# from user_groups ug
acspg-# where parent_group_id=1
acspg-# and not exists (select 1 from user_group_map ugm
acspg(# where ug.group_id=ugm.group_id)
acspg-# group by ug.group_id, group_name, ug.registration_date, ug.approved_p
acspg-# order by u_gname;