--make empty name
UPDATE attributes SET contents = contents || hstore('ad_nm:name', '')
    WHERE id IN
        (SELECT attributes_id FROM object_revision WHERE object_id=10002);

--wrong letter for RU + double space + begins with space
UPDATE attributes SET contents = contents || hstore('ad_nm:name', E' \u0433\u043E\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432z  \u041A\u0440\u044B\u043C')
    WHERE id IN
        (SELECT attributes_id FROM object_revision WHERE object_id=30002);

--name-missing
DELETE FROM object_revision WHERE object_id=20003;

--multiple names of one type
INSERT INTO attributes VALUES
    (901, hstore(ARRAY[
     ['cat:ad_nm', '1'],
     ['ad_nm:lang', 'ru'],
     ['ad_nm:name', E'\u0433\u043E\u0440\u043E\u0434 \u0421\u0435\u0432\u0430\u0441\u0442\u043E\u043F\u043E\u043B\u044C']])),
    (910, hstore(ARRAY[
     ['rel:role', 'official'],
     ['rel:slave', 'ad_nm'],
     ['rel:master', 'ad_subst']]));

INSERT INTO object_revision (object_id, commit_id, prev_commit_id, deleted, geometry_id, attributes_id, description_id, master_object_id, slave_object_id) VALUES
    (1000001, 1, 0, false, 0, 901, 0, 0, 0),
    (1000010, 1, 0, false, 0, 910, 0, 3004, 1000001);
