Given $p$ and $q$ morphisms on a category (preferably arbitrary, but it could be interesting to know on some other class of categories too), are there any useful necessary and/or sufficient conditions for them to be the pullback of some pair of morphisms? That is, are there conditions for there to exist morphisms $f$ and $g$ such that the diagram

is a pullback diagram for $f$ and $g$?
Let $B\times C$ denote a product of $B$ and $C$ with projections $\pi_B$ and $\pi_C$.
Then the unique arrow $e=<p,q>:A\to B\times C$ with $\pi_B\circ e=p$ and $\pi_C\circ e=q$ must be an equalizer.
This of arrows $f\circ\pi_B$ and $g\circ\pi_C$.
So if arrows $p,q$ with common domain can be recognized as pullbacks of arrows $g,f$ then $<p,q>$ is a regular monomorphism (i.e. an equalizer of a pair of arrows).
Unfortunately this condition is not sufficient (see the comment of @Arnaud on this answer) as I first stated wrongly.