Postgres Array Comparison In Python