We study the influence of the dimension of space on the thermodynamics of the
classical and quantum self-gravitating gas. We consider Hamiltonian systems of
self-gravitating particles described by the microcanonical ensemble and
self-gravitating Brownian particles described by the canonical ensemble. We
present a gallery of caloric curves in different dimensions of space and
discuss the nature of phase transitions as a function of the dimension d. We
also provide the general form of the Virial theorem in d dimensions and discuss
the particularity of the dimension d=4 for Hamiltonian systems and the
dimension d=2 for Brownian systems