Postgres Array Comparison In Python For All Selected Lines