Postgres Insert Into Array Javascript Iterations In Python