select idObj, nameObj, typeObj, stateObj, array_agg(Attr)from objects join attributes on attributes.idObj = objects.idObjgroup by nameObj, typeObjhaving objects.idObj = 1