Postgresql Plpgsql Loop Through Json In Typescript Vs React