Actually I would consider pgr_connectedComponents() a solution. It is not what I was initially looking for and introduces a dependency, but it is really short.