In my opinion it is mostly because of SQL and the way how aggregate queries are performed - aggregate functions and grouping are executed on large 2-dimensional rowsets to return results. That's the way it's been since the begginingbeginning and it is very fast (most NoSQL solutions are quite slow with aggregation and rely on denormalized schema instead of complex queries)
Of course PostgreSQL havehas some features from object-oriented database. According to this mails (message) you can achieve what you need by creating custom aggregate.
Personally I'm using frameworks like Doctrine ORM (PHP) which do the aggregation application-side and support features like lazy-loading to increase performance.