---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend
Seems the problem was with the custom aggregate function not being
able to handle thousands of rows.