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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marc Bachmann <marc.brookman@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, jeremy@musicsmith.net, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-10-03T17:22:48Z
Lists: pgsql-bugs, pgsql-hackers
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.