Re: WIP: updatable cursors in plpgsql - Mailing list pgsql-patches

From Tom Lane
Subject Re: WIP: updatable cursors in plpgsql
Date
Msg-id 10998.1181578822@sss.pgh.pa.us
Whole thread Raw
In response to Re: WIP: updatable cursors in plpgsql  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Responses Re: WIP: updatable cursors in plpgsql  ("Pavel Stehule" <pavel.stehule@gmail.com>)
List pgsql-patches
"Pavel Stehule" <pavel.stehule@gmail.com> writes:
> All explicit cursors (what I know) use named SQL cursors. SQL name is
> checked in OPEN statement. Refcursors are problematic. But refcursors
> are not updatable.

Sure they are, and besides which a bound cursor can still have a name
different from the SQL name --- you just assign something to it before
opening it.  So this patch just plain doesn't work.

As the code stands plpgsql will try to issue something like

    UPDATE/DELETE ... WHERE CURRENT OF $1

Since we don't try to do anything with the cursor name until runtime,
it seems that this would work if we allowed a parameter symbol there.
Offhand that doesn't look hard.

            regards, tom lane

pgsql-patches by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: WIP: updatable cursors in plpgsql
Next
From: "Pavel Stehule"
Date:
Subject: Re: WIP: updatable cursors in plpgsql