Postgres Select Count Statement In Python