Postgres Select Count Statement Python Ide