Postgres And Python Operator Priority Java