Calling a function that returns a refcursor
问题 I am using Postgresql 8.3 and have the following simple function that will return a refcursor to the client CREATE OR REPLACE FUNCTION function_1() RETURNS refcursor AS $$ DECLARE ref_cursor REFCURSOR; BEGIN OPEN ref_cursor FOR SELECT * FROM some_table; RETURN (ref_cursor); END; $$ LANGUAGE plpgsql; Now , I can use the following SQL commands to call this function and manipulate the returned cursor ,but the cursor name is automatically generated by the PostgreSQL BEGIN; SELECT function_1(); -