def verify_hll_schema(conn):
    'Function used to check whether HLL schema exists and that extension is installed correctly.'
    logger = logging.getLogger('dirbs.db')
    if (not query_schema_existence(conn, 'hll')):
        logger.error("Schema 'hll' does not exist. Please ensure the hll extension is installed and run the following as a superuser whilst connected to this DB: \n\t1. CREATE SCHEMA hll;\n\t2. GRANT USAGE ON SCHEMA hll TO dirbs_core_base;\n\t3. CREATE EXTENSION hll SCHEMA hll;")
        raise DatabaseSchemaException('HLL schema not created!')
    with conn.cursor() as cursor:
        try:
            cursor.execute("SELECT pg_get_functiondef('hll.hll_print(hll.hll)'::regprocedure)")
        except psycopg2.ProgrammingError:
            logger.error('The HLL extension is not installed correctly. Please issue the following as a superuser whilst connected to this DB: \n\tCREATE EXTENSION hll SCHEMA hll;')
            raise DatabaseSchemaException('DB search_path does not include hll or extension not installed!')
Function used to check whether HLL schema exists and that extension is installed correctly.
def verify_hll_schema(conn):
    
    logger = logging.getLogger('dirbs.db')
    if (not query_schema_existence(conn, 'hll')):
        logger.error("Schema 'hll' does not exist. Please ensure the hll extension is installed and run the following as a superuser whilst connected to this DB: \n\t1. CREATE SCHEMA hll;\n\t2. GRANT USAGE ON SCHEMA hll TO dirbs_core_base;\n\t3. CREATE EXTENSION hll SCHEMA hll;")
        raise DatabaseSchemaException('HLL schema not created!')
    with conn.cursor() as cursor:
        try:
            cursor.execute("SELECT pg_get_functiondef('hll.hll_print(hll.hll)'::regprocedure)")
        except psycopg2.ProgrammingError:
            logger.error('The HLL extension is not installed correctly. Please issue the following as a superuser whilst connected to this DB: \n\tCREATE EXTENSION hll SCHEMA hll;')
            raise DatabaseSchemaException('DB search_path does not include hll or extension not installed!')