WITH new_attr AS (
        INSERT INTO attributes (contents)
        VALUES (hstore(ARRAY[['cat:bld', '1'],
                             ['bld:ft_type_id', '101'],
                             ['bld:height', '-30']]))
        RETURNING id)
    UPDATE object_revision
    SET attributes_id = id FROM new_attr
    WHERE object_id = 4;

WITH new_attr AS (
        INSERT INTO attributes (contents)
        VALUES (hstore(ARRAY[['cat:bld', '1'],
                             ['bld:ft_type_id', '101']]))
        RETURNING id)
    UPDATE object_revision
    SET attributes_id = id FROM new_attr
    WHERE object_id = 5;

WITH new_attr AS (
        INSERT INTO attributes (contents)
        VALUES (hstore(ARRAY[['cat:bld', '1'],
                             ['bld:ft_type_id', '101'],
                             ['bld:height', 'полтораста']]))
        RETURNING id)
    UPDATE object_revision
    SET attributes_id = id FROM new_attr
    WHERE object_id = 6;
