Postgresql Function Parse Json Error Checker