Testing PostgreSQL functions that consume and return refcursor
问题 I want to test results of a Postgres function (changing the function is not a possibility). The function receives as arguments a REFCURSOR and several other things and returns the same RECURSOR. get_function_that_returns_cursor(ret, 4100, 'SOMETHING', 123465) Now I want to create a small test in Postgres to get the results of this FUNCTION. Something Like the code below (this is my approach but it is not working): DO $$ DECLARE ret REFCURSOR; row_to_read table_it_will_return%ROWTYPE ; BEGIN