Postgresql Function Parse Json String