I have a stored function returning a refcursor. I am able to retrieve the "<unnamed portal 1>" from the call. But I cannot figure out how to retrieve the rows of the refcursor.
logger.debug(`refcursor=${refcursor}`)
const cursor = conn`FETCH ALL IN "${refcursor}";`.cursor()
Further down there is a catch clause logging the error.
[12:36:10.198] ▶ DEBUG refcursor=<unnamed portal 1> src=dogwrapper
[12:36:10.200] ▶ ERROR fn_dogs_aggregate_v1: "Caught PostgresError: could not determine data type of parameter $1, rethrowing.