I am new to python and I am trying to do some server programming in pl/python (in order to achive speedier processing) and after many attemps I decided to resource on this list to look for help.
I want to call a pl/python function from another by passing a vessel_speed created type
CREATE TYPE vessel_speed AS (
mmsi integer,
sog real[]
);
CREATE OR REPLACE FUNCTION dummy(c_vessel vessel_speed)
RETURNS real[]
AS $$
return c_vessel["sog"]
$$ LANGUAGE plpython3u;
I am trying to call the dummy function from another pl/python in this manner:
st = "SELECT dummy(($1,ARRAY[$2])::vessel_speed)"
pst = plpy.prepare(st, ["integer", "real[]"])
rv = plpy.execute(pst, [112, (1.2,3.1)])
Returning an error:
ERROR: spiexceptions.FeatureNotSupported: cannot convert multidimensional array to Python list
Estado SQL:0A000
Detalle:PL/Python only supports one-dimensional arrays.
Anyone knows how to solve this?...or any alternative solution? Thanks a lot, Juan