Factors preventing planetary collapse towards the sun