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-03T03:48:06Z
Lists: pgsql-bugs, pgsql-hackers
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.  It looks like this was an accidental side-effect
of refactoring rather than something intentional.  Will look closer
tomorrow or so.

			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.