In this publication titled postgres aggregate functions string, I have provided a complete image from start to finish ,Please look below