text: create procedure iot.raw_put (
      req jsonb
  )
  as $$
  begin
      insert into iot.RAW (data) values (req);
  end;
  $$ language plpgsql;
  
  create procedure iot.raw_puts (
      arr jsonb
  )
  as $$
  declare
      r jsonb;
      ts_ float;
  begin
      for r in select * from jsonb_array_elements(arr)
      loop
          ts_ = (r->>'ts')::float;
          insert into iot.RAW(ts, data) values (ts_, r);
      end loop;
  end;
  $$ language plpgsql;
  