def _parsed_version(user=None, host=None, port=None, maintenance_db=None,
                    password=None, runas=None):

    psql_version = version(
        user,
        host=host,
        port=port,
        maintenance_db=maintenance_db,
        password=password,
        runas=runas,
    )

    if psql_version:
        return distutils.version.LooseVersion(psql_version)
    else:
        log.warning('Attempt to parse version of Postgres server failed. '
                    'Is the server responding?')
        return None
Returns the server version properly parsed and int casted for internal use.
dataset/ETHPy150Open saltstack/salt/salt/modules/postgres.py/_parsed_version