def METHOD_NAME(dbmap, engines):
    for layerId, models in dbmap.iteritems():
        tmp = []
        tmpColumns = []
        for model in models:
            matches = re.match(
                '^.*\/{1}([a-z]*_solarkataster)|^.*\/{1}([a-z]*)',
                model.metadata.__str__())
            dbname = matches.group(1) if matches.group(1) else matches.group(2)
            engine = engines.get(dbname)
            schema = model.__table_args__['schema'] if 'schema' in model.__table_args__ else 'public'
            tablename = model.__tablename__
            columnNames = [k.name for k in model.__table__.columns]
            tmp.append(getPGTables(layerId, engine, dbname, schema, tablename))
            tmpColumns += columnNames
        if len(models) > 1:
            print layerId
        result = [item for sublist in tmp for item in sublist]
        result = sorted(list(set(result)))
        resultColumns = sorted(list(set(tmpColumns)))
        yield layerId, result, resultColumns, len(models), dbname