Postgres Aggregate Functions Boolean Logic Explained