wip, postgres, array.reduce