       WHERE referenced_relation = 'specimen_parts'
         AND record_id = new_part_id;
       RAISE NOTICE '+++ Insurances after transfert for new part: %', recInsurances;
+      SELECT array_agg(people_ref)
+      INTO recProperties
+      FROM collection_maintenance
+      WHERE referenced_relation = 'specimen_parts'
+        AND record_id = new_part_id;
+      RAISE NOTICE '+++ Maintenance after transfert for new part: %', recProperties;
     END IF;
   END LOOP;
   return true;

$$
declare
  cat_prop_id integer := 0;
  cat_prop_unit varchar := 'm'
  prop_id integer := 0;
  prop_count integer;
  recUpdate RECORD;
  booNewInsert boolean := false;
begin
  /*Freshness level*/
  IF recPartsDetails.freshness_level IS NOT NULL THEN
    insert into catalogue_properties (referenced_relation, record_id, property_type, property_sub_type)
    (
      select 'specimen_parts', part_id, 'part state', 'freshness level'
      where not exists (
                          select 1
                          from catalogue_properties
                          where referenced_relation = 'specimen_parts'
                            and record_id = part_id
                            and property_type = 'part state'
                            and property_sub_type = 'freshness level'
                        )
    );
    select id into prop_id from catalogue_properties where referenced_relation = 'specimen_parts' and record_id = part_id and property_type = 'part state' and property_sub_type = 'freshness level';
    insert into properties_values (property_ref, property_value)
    (
      select prop_id, recPartsDetails.freshness_level
      where not exists (
                          select 1
                          from properties_values
                          where property_ref = prop_id
                            and property_value = recPartsDetails.freshness_level
                        )
    );
  END IF;
  /*Insurances*/
  IF coalesce(recPartsDetails.old_insurance_value,0) != 0 THEN
    update insurances
    set insurance_value = recPartsDetails.old_insurance_value
    where referenced_relation = 'specimen_parts'
      and record_id = part_id
      and insurance_year = coalesce(recPartsDetails.old_insurance_year,0);
    GET DIAGNOSTICS prop_count = ROW_COUNT;
    IF prop_count = 0 THEN
      insert into insurances (referenced_relation, record_id, insurance_value, insurance_year)
      (
        select 'specimen_parts', part_id, recPartsDetails.old_insurance_value, coalesce(recPartsDetails.old_insurance_year,0)
        where not exists (
                            select 1
                            from insurances
                            where referenced_relation = 'specimen_parts'
                              and record_id = part_id
                              and insurance_year = coalesce(recPartsDetails.old_insurance_year,0)
                        )
      );
    END IF;
  END IF;
  /*Maintenances*/

      WHERE referenced_relation = 'specimen_parts'
        AND record_id = part_id;
      RAISE NOTICE '+++ Insurances before transfert: %', recInsurances;
      SELECT array_agg(people_ref)
      INTO recProperties
      FROM collection_maintenance
      WHERE referenced_relation = 'specimen_parts'
        AND record_id = part_id;
      RAISE NOTICE '+++ Maintenance before transfert: %', recProperties;
      IF moveOrCreateProp(part_id, new_part_id, recPartsDetails, recFirstPart) < 0 THEN
        return false;
      END IF;
