Bondi accretion assumes that there is a sink of mass at the center -- which in case of a black hole (BH) corresponds to the advection of matter across the event horizon. Other stars, such as a neutron star (NS), have surfaces and hence the infalling matter has to slow down at the surface. We study the initial value problem in which the matter distribution is uniform and at rest at $t=0$. We consider different inner boundary conditions for BHs and NSs: outflow boundary condition (mimicking mass sink at the center) valid for BHs; and {\em reflective} and steady-shock (allowing gas to cross the inner boundary at subsonic speeds) boundary conditions for NSs. We also obtain a similarity solution for cold accretion on to BHs and NSs. 1-D simulations show the formation of an outward propagating and a standing shock in NSs for reflective and steady-shock boundary conditions, respectively. Entropy is the highest at the bottom of the subsonic region for reflective boundary conditions. In 2-D this profile is convectively unstable. Using steady-shock inner boundary conditions, the flow is unstable to the standing accretion shock instability (SASI) in 2-D, which leads to global shock oscillations and may be responsible for quasi-periodic oscillations (QPOs) seen in the lightcurves of accreting systems. For steady accretion in the quiescent state, spherical accretion rate on to a NS can be suppressed by orders of magnitude compared to that on to a BH.