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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Wieck <jan(at)wi3ck(dot)info>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, wolakk(at)gmail(dot)com
Subject: Re: PL/pgSQL cursors should get generated portal names by default
Date: 2022-11-04 23:46:39
Message-ID: 2504191.1667605599@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jan Wieck <jan(at)wi3ck(dot)info> 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 application needs to know
> the name of the portal.

Right. With this patch, it'd be necessary to hand back the actual
portal name (by returning the refcursor value), or else manually
set the refcursor value before OPEN to preserve the previous behavior.
But as far as I saw, all our documentation examples show handing back
the portal name, so I'm hoping most people do it like that already.

> I am currently down with Covid and have trouble focusing. But I hope to
> get to it some time next week.

Get well soon!

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2022-11-04 23:54:12 Re: CI and test improvements
Previous Message Jan Wieck 2022-11-04 23:19:19 Re: PL/pgSQL cursors should get generated portal names by default