Postgres Array Comparison In Python Program