node-postgres icon indicating copy to clipboard operation
node-postgres copied to clipboard

Undefined row fields when calling select * in a stored function

Open JVerstry opened this issue 12 years ago • 1 comments

I have created a Stackoverflow question, because I came across an issue (see: http://stackoverflow.com/questions/21932378/extracting-results-from-a-select-in-node-pg/21934047).

When a stored function contains a SELECT * statement and it is called from Node PG, it seems PG is able to detect that some rows are returned. However, the fields' content is undefined.

It seems that the returned result is something like: (SID-1,{},10) and that pg does not parse it properly.

JVerstry avatar Feb 21 '14 12:02 JVerstry

My bad, I was not calling PG properly. I should have called:

SELECT * FROM SessionGet('SID-1'::varchar);

instead of:

SELECT SessionGet('SID-1'::varchar);

JVerstry avatar Feb 21 '14 14:02 JVerstry