Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oHQTC-0004Lt-R4 for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Jul 2022 13:56:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oHQTB-0007Cj-N2 for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Jul 2022 13:56:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oHQTB-0007Ca-El for pgsql-bugs@lists.postgresql.org; Fri, 29 Jul 2022 13:56:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oHQT8-0001LS-8s for pgsql-bugs@lists.postgresql.org; Fri, 29 Jul 2022 13:56:00 +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 26TDtrC03753051; Fri, 29 Jul 2022 09:55:53 -0400 From: Tom Lane To: Alvaro Herrera cc: kyzevan23@mail.ru, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17561: Server crashes on executing row() with very long argument list In-reply-to: <20220729101411.7b45rvhlrsgcajjo@alvherre.pgsql> References: <20220729101411.7b45rvhlrsgcajjo@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Fri, 29 Jul 2022 12:14:11 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3753049.1659102953.1@sss.pgh.pa.us> Date: Fri, 29 Jul 2022 09:55:53 -0400 Message-ID: <3753050.1659102953@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > On 2022-Jul-29, PG Bug reporting form wrote: >> When executing the following query: >> (echo "SELECT row("; for ((i=1;i<100001;i++)); do echo "'$i',$i,"; done; >> echo "'0',0);"; ) | psql >> I got server crash with the following backtrace > Hah, of course. I suppose we'd need something like this ... haven't > looked for other problem spots. I think the parser should've prevented this. It's in charge of rejecting overlength SELECT lists, for example. Also, the limit probably needs to be just MaxTupleAttributeNumber. regards, tom lane