Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Returns an integer representing the major, minor and revision number of the
server. Format is the one used for the return value of libpq
PQServerVersion()/``server_version`` connection attribute (available in
newer psycopg2 versions.)

For example, 80304 for 8.3.4. The last two digits will be 00 in the case of
releases (e.g., 80400 for 'PostgreSQL 8.4') or in the case of beta and
prereleases (e.g. 90100 for 'PostgreSQL 9.1beta2').

PQServerVersion()/``server_version`` doesn't execute a query so try that(more...)

        def get_version(connection):
    """
    Returns an integer representing the major, minor and revision number of the
    server. Format is the one used for the return value of libpq
    PQServerVersion()/``server_version`` connection attribute (available in
    newer psycopg2 versions.)

    For example, 80304 for 8.3.4. The last two digits will be 00 in the case of
    releases (e.g., 80400 for 'PostgreSQL 8.4') or in the case of beta and
    prereleases (e.g. 90100 for 'PostgreSQL 9.1beta2').

    PQServerVersion()/``server_version`` doesn't execute a query so try that
    first, then fallback to a ``SELECT version()`` query.
    """
    if hasattr(connection, 'server_version'):
        return connection.server_version
    else:
        cursor = connection.cursor()
        cursor.execute("SELECT version()")
        return _parse_version(cursor.fetchone()[0])
        


src/d/j/django-orm-2.0.5/django_orm/backends/postgresql_psycopg2/base.py   django-orm(Download)
    def postgres_version(self):
        from django_orm.backends.postgresql_psycopg2.version import get_version
        if not hasattr(self, '_postgres_version'):
            self.__class__._postgres_version = get_version(self.connection)
        return self._postgres_version