Postgresql Drop Duplicate In Python