out参数结果由节点pg module – postgresql返回

我已经在postgresql中创build了一个过程如下。

CREATE OR REPLACE FUNCTION public.functiontest2( IN data numeric, OUT result numeric, OUT result1 numeric) RETURNS record AS $BODY$ DECLARE declare SEQVAL decimal := 10; BEGIN result=SEQVAL; result1=data; END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100; 

现在我已经从节点pg执行了这个程序

 client.query('select functionTest2(10)', input, function(err, result){}); 

以前,当我执行上面的代码时,它给了我以下格式的结果。

 { "command":"SELECT", "rowCount":1, "oid":null, "rows":[{"result":"10"},{"result1":"10"}], "fields":[{"name":"result","tableID":0,"columnID":0,"dataTypeID":1700,"dataTypeSize":-1,"dataTypeModifier":-1,"format":"text"}], "_parsers":[null], "rowAsArray":false } 

但是现在我已经卸载了节点pg模块并重新安装了节点pg模块。 这是给我以下格式的结果

 { "command":"SELECT", "rowCount":1, "oid":null, "rows":[{"functiontest2":"(10,10)"}], "fields": [{"name":"functiontest2","tableID":0,"columnID":0,"dataTypeID":2249,"dataTypeSize":-1,"dataTypeModifier":-1,"format":"text"}], "_parsers":[null], "rowAsArray":false} 

因此,区别在于logging不是返回名称值对,而是返回函数名称和值数组。 我曾尝试安装不同版本的节点pg模块,但问题仍然存在。

提前致谢。

好吧..球员我发现问题..其实我需要使用查询像select * from function2(10); 它解决了问题