Postgresql Insert Into Array Javascript Iterations In Python