Postgresql Loop Through Rows In Pandas