  We review the problem of describing the gravitational field of compact stars
in general relativity. We focus on the deviations from spherical symmetry which
are expected to be due to rotation and to the natural deformations of mass
distributions. We assume that the relativistic quadrupole moment takes into
account these deviations, and consider the class of axisymmetric static and
stationary quadrupolar metrics which satisfy Einstein's equations in empty
space and in the presence of matter represented by a perfect fluid. We
formulate the physical conditions that must be satisfied for a particular
spacetime metric to describe the gravitational field of compact stars. We
present a brief review of the main static and axisymmetric exact solutions of
Einstein's vacuum equations, satisfying all the physical conditions. We discuss
how to derive particular stationary and axisymmetric solutions with quadrupolar
properties by using the solution generating techniques which correspond either
to Lie symmetries and B\"ackund transformations of the Ernst equations or to
the inverse scattering method applied to Einstein's equations. As for interior
solutions, we argue that it is necessary to apply alternative methods to obtain
physically meaningful solutions, and review a method which allows us to
generate interior perfect-fluid solutions.
