  For $\alpha \in \mathbb{R}$, let $\mathscr{D}_\alpha$ denote the scale of
Hilbert spaces consisting of Dirichlet series $f(s) = \sum_{n=1}^\infty a_n
n^{-s}$ that satisfy $\sum_{n=1}^\infty |a_n|^2/[d(n)]^\alpha < \infty$. The
Gordon--Hedenmalm Theorem on composition operators for
$\mathscr{H}^2=\mathscr{D}_0$ is extended to the Bergman case $\alpha>0$. These
composition operators are generated by functions of the form $\Phi(s) = c_0 s +
\varphi(s)$, where $c_0$ is a nonnegative integer and $\varphi(s)$ is a
Dirichlet series with certain convergence and mapping properties. For the
operators with $c_0=0$ a new phenomenon is discovered: If $0 < \alpha < 1$, the
space $\mathscr{D}_\alpha$ is mapped by the composition operator into a smaller
space in the same scale. When $\alpha > 1$, the space $\mathscr{D}_\alpha$ is
mapped into a larger space in the same scale. Moreover, a partial description
of the composition operators on the Dirichlet--Bergman spaces $\mathscr{A}^p$
for $1 \leq p < \infty$ are obtained, in addition to new partial results for
composition operators on the Dirichlet--Hardy spaces $\mathscr{H}^p$ when $p$
is an odd integer.

Functional Analysis