  Let $X$ be a compact Riemann surface. A quadratic pair on $X$ consists of a
holomorphic vector bundle with a quadratic form which takes values in fixed
line bundle. We show that the moduli spaces of quadratic pairs of rank 2 are
connected under some constraints on their topological invariants. As an
application of our results we determine the connected components of the
$\mathrm{SO}_0(2,3)$-character variety of $X$.
