cursors WITH HOLD in plpgsql
<p>Does Postgres allow to create cursors with option WITH HOLD using plpgsql? 
I want something like this:</p>

<pre><code>CREATE FUNCTION foo()
RETURNS refcursor 
LANGUAGE plpgsql
AS $$ 
DECLARE
    ref refcursor WITH HOLD;
BEGIN
    OPEN refcur FOR 
        SELECT some_data FROM some_table 
    RETURN ref;
END;
$$;
</code></pre>

<p>The more common problem is to find a way to use Postgres's cursors out of a transaction block. But cursor should be created automatically without name specification. </p>