You are misinterpreting Berger's theorem; it's not even true for compact Riemannian manifolds. See *On compact Riemannian manifolds with noncompact holonomy groups*, Burkhard Wilking. J. Differential Geom. Volume 52, Number 2 (1999), 223-257.

What *is* true is that, for a simply-connected Riemannian manifold, the holonomy group is connected and compact.  This is a consequence of Berger's theorem, but it also needs the fact that the holonomy in this case is the product of holonomy groups of locally irreducible Riemannian manifolds.  See Besse's treatment and discussion in his book *Einstein manifolds* for details.