Postgresql Loop Through Array Python Definition A Programming