Re: BUG #18984: Empty prepared statement from psql \parse triggers assert in PortalRunMulti

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

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Aleksander Alekseev <aleksander@tigerdata.com>
Cc: pgsql-bugs@lists.postgresql.org, exclusion@gmail.com
Date: 2025-07-14T21:40:22Z
Lists: pgsql-bugs

Attachments

Aleksander Alekseev <aleksander@tigerdata.com> writes:
>> That being the case, maybe we should band-aid this by returning
>> EXECUTE if the prepared statement is empty.

> This sounds pretty straightforward and seems to solve the problem.
> Patch attached.

Hmm, throwing an error is exactly not what I was suggesting above.
The attached quick draft (needs attention to comments) results in

regression=# \parse s

regression=# execute s;
EXECUTE

which matches the behavior of pre-v12 servers.

(BTW, I wonder why psql is emitting an extra newline after \parse.)

			regards, tom lane

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Minor cosmetic tweaks

  2. Simplify coding in ProcessQuery

  3. Remove assertion from PortalRunMulti

  4. Represent command completion tags as structs