LINUX.ORG.RU

История изменений

Исправление Psilocybe, (текущая версия) :

select  json_build_object( author,json_object_agg (account,users) )
from (
select author,account,  array_agg( distinct usr) as users
from   forms,unnest(users) as usr
group by author,account
) t
group by author

Исходная версия Psilocybe, :

select  jsonb_build_object( author,json_object_agg (account,users) )
from (
select author,account,  array_agg( distinct usr) as users
from   forms,unnest(users) as usr
group by author,account
) t
group by author