Re: PL/pgSQL cursors should get generated portal names by default

2023-01-09 Thread Pavel Stehule
Hi I wrote a new check in plpgsql_check, that tries to identify explicit work with the name of the referenced portal. create or replace function foo01() returns refcursor as $$#option dump declare c cursor for select 1; r refcursor; begin open c; r := 'c'; return r; end; $$ language plp

Re: PL/pgSQL cursors should get generated portal names by default

2022-11-08 Thread Kirk Wolak
On Mon, Nov 7, 2022 at 11:10 AM Jan Wieck wrote: > On 11/4/22 19:46, Tom Lane wrote: > > Jan Wieck writes: > >> I need to do some testing on this. I seem to recall that the naming was > >> originally done because a reference cursor is basically a named cursor > >> that can be handed around betwe

Re: PL/pgSQL cursors should get generated portal names by default

2022-11-07 Thread Jan Wieck
My comments were in no way meant as an argument for or against the change itself. Only to clearly document the side effect it will have. Regards, Jan On 11/7/22 11:57, Kirk Wolak wrote: On Mon, Nov 7, 2022 at 11:10 AM Jan Wieck > wrote: On 11/4/22 19:46, Tom L

Re: PL/pgSQL cursors should get generated portal names by default

2022-11-07 Thread Pavel Stehule
Dne po 7. 11. 2022 17:10 uživatel Jan Wieck napsal: > On 11/4/22 19:46, Tom Lane wrote: > > Jan Wieck writes: > >> I need to do some testing on this. I seem to recall that the naming was > >> originally done because a reference cursor is basically a named cursor > >> that can be handed around be

Re: PL/pgSQL cursors should get generated portal names by default

2022-11-07 Thread Jan Wieck
On 11/4/22 19:46, Tom Lane wrote: Jan Wieck writes: I need to do some testing on this. I seem to recall that the naming was originally done because a reference cursor is basically a named cursor that can be handed around between functions and even the top SQL level of the application. For the

Re: PL/pgSQL cursors should get generated portal names by default

2022-11-04 Thread Tom Lane
Jan Wieck writes: > I need to do some testing on this. I seem to recall that the naming was > originally done because a reference cursor is basically a named cursor > that can be handed around between functions and even the top SQL level > of the application. For the latter to work the applicat

Re: PL/pgSQL cursors should get generated portal names by default

2022-11-04 Thread Jan Wieck
On 11/4/22 03:22, Pavel Stehule wrote: Hi st 2. 11. 2022 v 0:39 odesílatel Tom Lane > napsal: There's a complaint at [1] about how you can't re-use the same cursor variable name within a routine called from another routine that's already using that name.

Re: PL/pgSQL cursors should get generated portal names by default

2022-11-04 Thread Pavel Stehule
Hi st 2. 11. 2022 v 0:39 odesílatel Tom Lane napsal: > There's a complaint at [1] about how you can't re-use the same > cursor variable name within a routine called from another routine > that's already using that name. The complaint is itself a bit > under-documented, but I believe it is refe

Re: PL/pgSQL cursors should get generated portal names by default

2022-11-01 Thread Pavel Stehule
st 2. 11. 2022 v 0:39 odesílatel Tom Lane napsal: > There's a complaint at [1] about how you can't re-use the same > cursor variable name within a routine called from another routine > that's already using that name. The complaint is itself a bit > under-documented, but I believe it is referring

PL/pgSQL cursors should get generated portal names by default

2022-11-01 Thread Tom Lane
There's a complaint at [1] about how you can't re-use the same cursor variable name within a routine called from another routine that's already using that name. The complaint is itself a bit under-documented, but I believe it is referring to this ancient bit of behavior: A bound cursor v