Postgres Select Count Statement Python