'Delete PostgreSQL many2many relations tracked by this model.'

@api.multi
def _module_data_uninstall(self):

    if (not ((self._uid == SUPERUSER_ID) or self.env.user.has_group('base.group_system'))):
        raise AccessError(_('Administrator    access    is    required    to    uninstall    a    module'))
    ids_set = set(self.ids)
    to_drop = tools.OrderedSet()
    for data in self.sorted(key='id', reverse=True):
        name = tools.ustr(data.name)
        self._cr.execute('SELECT    id    from    ir_model_relation    where    name    =    %s', (data.name,))
        external_ids = set((x[0] for x in self._cr.fetchall()))
        if (external_ids - ids_set):
            continue
        self._cr.execute('SELECT    1    FROM    information_schema.tables    WHERE    table_name=%s', (name,))
        if self._cr.fetchone():
            to_drop.add(name)
    self.unlink()
    for table in to_drop:
        self._cr.execute(('DROP    TABLE    %s    CASCADE' % table))
        _logger.info('Dropped    table    %s', table)
