'Check that the backend fully supports the provided aggregate.
The implementation of population statistics (STDDEV_POP and VAR_POP)
under Postgres 8.2 - 8.2.4 is known to be faulty. Raise
NotImplementedError if this is the database in use.'

def check_aggregate_support(self, aggregate):

    if (aggregate.sql_function in (u'STDDEV_POP', u'VAR_POP')):
        pg_version = self.connection.pg_version
        if ((pg_version >= 80200) and (pg_version <= 80204)):
            raise NotImplementedError((u'PostgreSQL    8.2    to    8.2.4    is    known    to    have    a    faulty    implementation    of    %s.    Please    upgrade    your    version    of    PostgreSQL.' % aggregate.sql_function))
