Re: BUG #16040: PL/PGSQL RETURN QUERY statement never uses a parallel plan

Marc Bachmann <marc.brookman@gmail.com>

From: Marc Bachmann <marc.brookman@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, jeremy@musicsmith.net, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-10-03T18:01:56Z
Lists: pgsql-bugs, pgsql-hackers
I’m happy to help.
And sorry that you had to go through that many changes right after the release.

Kind regards
Marc

> On 3 Oct 2021, at 19:22, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> I wrote:
>> Marc Bachmann <marc.brookman@gmail.com> writes:
>>> A function that inserts data and tries to return with a table now results in the error `query is not a SELECT`.
>>> In previous versions that query succeeded.
> 
>> Hmm ... I'm a bit surprised that that worked before, but since it did,
>> we shouldn't break it.
> 
> Fix pushed, thanks for the report!
> 
> 			regards, tom lane




Commits

  1. Fix checking of query type in plpgsql's RETURN QUERY command.

  2. Avoid using a cursor in plpgsql's RETURN QUERY statement.