Re: [PATCHES] WIP: updatable cursors in plpgsql

2007-06-11 Thread Pavel Stehule
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. I tested it. I

Re: [PATCHES] WIP: updatable cursors in plpgsql

2007-06-11 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> 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

Re: [PATCHES] WIP: updatable cursors in plpgsql

2007-06-11 Thread Pavel Stehule
No, the question is what is the patch trying to accomplish, because as far as I can see it's wrong. It seems to be trying to insert the plpgsql name of the cursor, which is not necessarily the SQL name. All explicit cursors (what I know) use named SQL cursors. SQL name is checked in OPEN sta

Re: [PATCHES] WIP: updatable cursors in plpgsql

2007-06-11 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > 2007/6/11, Tom Lane <[EMAIL PROTECTED]>: >> Why do we need this? >> > For stored procedures. No, the question is what is the patch trying to accomplish, because as far as I can see it's wrong. It seems to be trying to insert the plpgsql name of the c

Re: [PATCHES] WIP: updatable cursors in plpgsql

2007-06-11 Thread Pavel Stehule
2007/6/11, Tom Lane <[EMAIL PROTECTED]>: "Pavel Stehule" <[EMAIL PROTECTED]> writes: > this small patch allows using updatable cursors in plpgsql. Why do we need this? For stored procedures. Updatable cursors are used mainly in transform procedures, and without suppport in plpgsql, you have to

Re: [PATCHES] WIP: updatable cursors in plpgsql

2007-06-11 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > this small patch allows using updatable cursors in plpgsql. Why do we need this? regards, tom lane ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by