Postgres Find Duplicate Rows In Python