               'WHERE i.record_id = ' || quote_literal(ref_field_id) || 
               '  AND people_ref = ' || quote_literal(OLD.people_ref) || 
               '  AND i.referenced_relation = ' || quote_literal(ref_relation) INTO rec_exists ;
-      /* 'IF rec_exists then that people exist in an other identification of the same record, so we must not remove it from flat' */
       IF rec_exists IS NOT NULL THEN
         RETURN OLD;
       END IF ;

              'WHERE ' || quote_ident(ref_field) || ' = ' || quote_literal(ref_field_id) ;
    END IF;
  END IF;  
  RETURN NEW;
END;
$$ language plpgsql;

            '              WHERE ' || quote_ident(field_to_update) || ' && ARRAY[' || NEW.people_ref::integer || '] ' || 
            '                AND ' || quote_ident(ref_field) || ' = ' || quote_literal(ref_field_id) ||
            '             )' INTO rec_exists ;
    IF rec_exists = TRUE THEN
      RETURN NEW ;
    END IF;
