Postgresql Row To Array Python Example For Loop