Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ubSQk-0013H8-WD for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Jul 2025 23:17:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ubSQi-00F5gO-7d for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Jul 2025 23:17:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ubSQh-00F5gG-VZ for pgsql-bugs@lists.postgresql.org; Mon, 14 Jul 2025 23:17:52 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ubSQg-007m68-0j for pgsql-bugs@lists.postgresql.org; Mon, 14 Jul 2025 23:17:52 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 56ENHlS5799186; Mon, 14 Jul 2025 19:17:47 -0400 From: Tom Lane To: exclusion@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18984: Empty prepared statement from psql \parse triggers assert in PortalRunMulti In-reply-to: <715434.1752521761@sss.pgh.pa.us> References: <18984-0f4778a6599ac3ae@postgresql.org> <715434.1752521761@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 14 Jul 2025 15:36:01 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <799184.1752535067.1@sss.pgh.pa.us> Date: Mon, 14 Jul 2025 19:17:47 -0400 Message-ID: <799185.1752535067@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > BTW, d55322b0d simply made it easy to trigger the bug from psql. > If I use current psql to connect to older servers, I can demonstrate > crashes (or sometimes "stack depth limit exceeded") back to v12. I think I fat-fingered something, because now I can only reproduce back to v13. Bisecting says the crash started at the v13-era commit commit 2f9661311b83dc481fc19f6e3bda015392010a40 Author: Alvaro Herrera Date: Mon Mar 2 18:19:51 2020 -0300 Represent command completion tags as structs which is unsurprising because that's what introduced the Assert we're hitting. BTW, with Asserts disabled it works fine: $ psql postgres psql (19devel) Type "help" for help. postgres=# \parse s postgres=# execute s; EXECUTE which is another reason not to start throwing an error. (I did not look into how come that works... the correct command tag must be getting filled in later, but where?) regards, tom lane