driver/collector/postgres_collector.py
def _load_stat_statements(self) -> bool:
        """
        Load pg_stat_statements module if it does not exist.
        Returns:
            True if module is loaded successfully, otherwise return False.
        """

        check_module_sql = (
            "SELECT count(*) FROM pg_extension where extname='pg_stat_statements';"
        )
        load_module_sql = "CREATE EXTENSION pg_stat_statements;"
        module_exists = self._cmd(check_module_sql)[0][0][0] == 1
        if not module_exists:
            try:
                self._conn.cursor().execute(load_module_sql)
                self._conn.commit()
            except Exception as ex:  # pylint: disable=broad-except
                logging.error("Failed to load pg_stat_statements module: %s", ex)
                self._conn.rollback()
                return False
        return True

        Load pg_stat_statements module if it does not exist.
        Returns:
            True if module is loaded successfully, otherwise return False.
        
Load pg_stat_statements module if it does not exist.
Load pg_stat_statements module if it does not exist .
def _load_stat_statements(self) -> bool:
        check_module_sql = (
            "SELECT count(*) FROM pg_extension where extname='pg_stat_statements';"
        )
        load_module_sql = "CREATE EXTENSION pg_stat_statements;"
        module_exists = self._cmd(check_module_sql)[0][0][0] == 1
        if not module_exists:
            try:
                self._conn.cursor().execute(load_module_sql)
                self._conn.commit()
            except Exception as ex:  
                logging.error("Failed to load pg_stat_statements module: %s", ex)
                self._conn.rollback()
                return False
        return True
def _load_stat_statements ( self ) -> bool : check_module_sql = ( "SELECT count(*) FROM pg_extension where extname='pg_stat_statements';" ) load_module_sql = "CREATE EXTENSION pg_stat_statements;" module_exists = self . _cmd ( check_module_sql ) [ 0 ] [ 0 ] [ 0 ] == 1 if not module_exists : try : self . _conn . cursor ( ) . execute ( load_module_sql ) self . _conn . commit ( ) except Exception as ex : logging . error ( "Failed to load pg_stat_statements module: %s" , ex ) self . _conn . rollback ( ) return False return True
Load pg_stat_statements module if it does not exist.
Load pg_stat_statements module if it does not exist .
"""
        Load pg_stat_statements module if it does not exist.
        Returns:
            True if module is loaded successfully, otherwise return False.
        """ # pylint: disable=broad-except
True if module is loaded successfully, otherwise return False.
True if module is loaded successfully otherwise return False .
self