I have created a procedure in postgresql as below.
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;
Now I have executed this procedure from node pg as
client.query('select functionTest2(10)', input, function(err, result){});
Previously, When I executed above code , It had given me result in following format.
{
"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
}
But now I have uninstalled node pg module and installed node pg module again. It is giving me result in following format
{
"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}
Thus, The difference is instead of returning name value pair for records, It returns function name and value array. I have tried installing different version of node pg module but the problem persists.
Thanks in advance.