 end;
 $$;
 
-select updatePeriphData('specimen_individuals') as IndPeriphDataUpdated;
-select updatePeriphData('specimens') as SpecPeriphDataUpdated;
-
 create or replace function indMergeCountMinMax () returns boolean language plpgsql as $$
 declare
   recConcerned RECORD;

  GET DIAGNOSTICS rowsDeleted = ROW_COUNT;
  RAISE NOTICE '% rows deleted.', rowsDeleted;
  return true;
end;
$$;

select eraseDupliInd() as IndividualsInDuplicationDeleted;

drop function if exists updateParts();
drop function if exists updatePeriphData(table_concerned varchar);
drop function if exists indMergeCountMinMax();
drop function if exists eraseDupliInd();

rollback;

  return 0;
end;
$$;

/* Function updating peripheral data for either specimens or specimen_individuals
   It will select from array of duplicated specimens or individuals the ones to be merged and the one to be merged into.
