Postgresql change value of json inside function