Postgresql Function Parse Json Python