code: def check_rules(self):
          
          query = """
          select n.nspname as rule_schema,
          c.relname as rule_table,
          case r.ev_type
              when '1' then 'SELECT'
              when '2' then 'UPDATE'
              when '3' then 'INSERT'
              when '4' then 'DELETE'
              else 'UNKNOWN'
          end as rule_event
          from pg_rewrite r
          join pg_class c on r.ev_class = c.oid
          left join pg_namespace n on n.oid = c.relnamespace
          left join pg_description d on r.oid = d.objoid
          WHERE n.nspname NOT IN {excl}
              AND r.rulename != '_RETURN'
              AND n.nspname NOT LIKE 'pg\_%'
          ORDER BY n.nspname, c.relname, rule_event
          """.format(excl=self.exclude_schema)
  
          return self.__check_equals(query)
docs: Check if the rules are equals.
  
              Returns
              -------
              bool
                  True if the rules are the same
                  False otherwise
              list
                  A list with the differences