这个函数调用是否有任何理由不会返回“结果”?
CREATE OR REPLACE FUNCTION myfunction (input int, OUT result int) AS $$
result = mymodule.object(input,plpy)
plpy.info(" ========= EXTRA-module result: ===",result)
$$ LANGUAGE plpythonu;
=== mymodule的内容============
def object(input,plpy):
import StringIO
try:
plan = plpy.prepare("INSERT INTO file VALUES (nextval('primary_sequence'),$1) RETURNING primary_key", ["integer"] )
except:
plpy.error(traceback.format_exc())
try:
rv = plpy.execute(plan, [ input ])
result = rv[0]["primary_key"]
plpy.info(" ========= INTRA-module result: ===",result)
return result
except:
plpy.error(traceback.format_exc())