plcontainer icon indicating copy to clipboard operation
plcontainer copied to clipboard

ERROR when output record descriptor changes

Open BaiShaoqi opened this issue 6 years ago • 1 comments

Expected behavior


   t  | val
 -----+-----
  abc |  10
 (1 row)
 
   t  | val
 -----+-----
  abc |  10
 (1 row)
 

Actual behavior

 ERROR:  function return row and query-specified return row do not match
 DETAIL:  Returned type integer at ordinal position 2, but query expects bigint.
 
 ERROR:  function return row and query-specified return row do not match
 DETAIL:  Returned type text at ordinal position 1, but query expects character varying.
 

Step to reproduce the behavior

CREATE FUNCTION return_record(t text) RETURNS record AS $$
# container: plc_python_shared
return {'t': t, 'val': 10}
$$ LANGUAGE plcontainer;

SELECT * FROM return_record('abc') AS r(t text, val bigint);

SELECT * FROM return_record('abc') AS r(t varchar(30), val integer);


BaiShaoqi avatar Jun 01 '18 06:06 BaiShaoqi