pgsql: Remove assertion from PortalRunMulti

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove assertion from PortalRunMulti
Date: 2025-07-17 15:41:44
Message-ID: E1ucQjw-006mPK-29@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove assertion from PortalRunMulti

We have an assertion to ensure that a command tag has been assigned by
the time we're done executing, but if we happen to execute a command
with no queries, the assertion would fail. Per discussion, rather than
contort things to get a tag assigned, just remove the assertion.

Oversight in 2f9661311b83. That commit also retained a comment that
explained logic that had been adjacent to it but diffused into various
places, leaving none apt to keep part of the comment. Remove that part,
and rewrite what remains for extra clarity.

Bug: #18984
Backpatch-through: 13
Reported-by: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Reviewed-by: Michaël Paquier <michael(at)paquier(dot)xyz>
Discussion: https://postgr.es/m/18984-0f4778a6599ac3ae@postgresql.org

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0c466f5e0b34bb9ddc53a422e9872b726f5f9620

Modified Files
--------------
src/backend/tcop/pquery.c | 25 ++++++++-----------------
1 file changed, 8 insertions(+), 17 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Aleksander Alekseev 2025-07-17 16:11:36 Re: pgsql: Remove assertion from PortalRunMulti
Previous Message Nathan Bossart 2025-07-17 15:27:18 pgsql: doc: Add note about how to use pg_overexplain.