   
   delta_token:=uuid_generate_v5(uuid_ns_provsql(),concat('delta',token));
 
-  PERFORM create_gate(delta_token,'delta',ARRAY[token]);
+  PERFORM create_gate(delta_token,'delta',ARRAY[token::uuid]);
 
   RETURN delta_token;
 END

  LOCK TABLE provenance_circuit_extra;
  SELECT 1 FROM provenance_circuit_extra WHERE gate = eq_token INTO rec;
  IF rec IS NULL THEN
    PERFORM create_gate(eq_token, 'eq', ARRAY[token]);
    PERFORM set_infos(eq_token, pos1, pos2);
    INSERT INTO provenance_circuit_extra VALUES(eq_token, pos1, pos2);
  END IF;

CREATE OR REPLACE FUNCTION create_gate(
  token provenance_token,
  type provenance_gate,
  children uuid[] DEFAULT NULL)
  RETURNS void AS
  'provsql','create_gate' LANGUAGE C;
CREATE OR REPLACE FUNCTION get_gate_type(
