Defensive programming should be done like a process. Start with all the checks in your code and finally move the checks to a centralized place so that you have reliable exit.
For example, I would had a stored procedure for validating the data.
Or I would have made the smartest decision of using Postgres and live happily there after.
I slightly disagree. There is a tradeoff between what the local market wants Vs what startups develop. Frankly, the local market in India doesn't need a startup that can index all the planets and stars and make it searchable. They first need something as simple as this one.
For example, I would had a stored procedure for validating the data.
Or I would have made the smartest decision of using Postgres and live happily there after.