Merge pull request #16954 from geoffharcourt/inject-over-sum

Use #inject over #sum to build PG create DB statement