'Merge two database together.
Parameters
other : `VOSDatabase`
The other database to merge.
kwargs : dict
Keywords accepted by :func:`add_catalog`.
Returns
db : `VOSDatabase`
Merged database.
Raises
VOSError
Invalid database or incompatible version.'

def merge(self, other, **kwargs):

    if (not isinstance(other, VOSDatabase)):
        raise VOSError(u'{0}    is    not    a    VO    database.'.format(other))
    if (other.version != self.version):
        raise VOSError(u'Incompatible    database    version:    {0},    {1}'.format(self.version, other.version))
    db = VOSDatabase.create_empty()
    for old_db in (self, other):
        for (key, cat) in old_db.get_catalogs():
            db.add_catalog(key, cat, **kwargs)
    return db
