Re: WIP: updatable cursors in plpgsql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: WIP: updatable cursors in plpgsql
Date: 2007-06-11 16:20:22
Message-ID: 10998.1181578822@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

"Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message FAST PostgreSQL 2007-06-12 03:10:23 Re: COPYable logs status
Previous Message Pavel Stehule 2007-06-11 15:45:14 Re: WIP: updatable cursors in plpgsql