create view public.v_profile as
 select t_profile.pk,
  t_profile.forename,
  t_profile.surname,
  t_profile.username,
  t_profile.password,
  t_profile.uuid,
  array_agg(t_profilerole.role) as roles
   from (public.t_profile
   left join public.t_profilerole on ((t_profilerole.fk_profile = t_profile.pk)))
  where (t_profile.duedate > now())
  group by t_profile.pk, t_profile.forename, t_profile.surname, t_profile.username, t_profile.password;
