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 1oHTJG-0007Nb-MB for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Jul 2022 16:57:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oHTJF-0000Fn-JH for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Jul 2022 16:57:57 +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 1oHTJF-0000Fe-Bh for pgsql-bugs@lists.postgresql.org; Fri, 29 Jul 2022 16:57:57 +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 1oHTJD-0002kr-6f for pgsql-bugs@lists.postgresql.org; Fri, 29 Jul 2022 16:57:56 +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 26TGvnmg3822707; Fri, 29 Jul 2022 12:57:49 -0400 From: Tom Lane To: Richard Guo cc: Alvaro Herrera , kyzevan23@mail.ru, PostgreSQL mailing lists Subject: Re: BUG #17561: Server crashes on executing row() with very long argument list In-reply-to: References: <20220729101411.7b45rvhlrsgcajjo@alvherre.pgsql> <3753050.1659102953@sss.pgh.pa.us> <3768321.1659105655@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Sat, 30 Jul 2022 00:24:06 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3822705.1659113869.1@sss.pgh.pa.us> Date: Fri, 29 Jul 2022 12:57:49 -0400 Message-ID: <3822706.1659113869@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > The patch looks good to me. Just wondering if there are any other types > of expressions that need to check for MaxTupleAttributeNumber in > parse_expr.c. As far as I can think, sub-SELECTs and ROW constructs are the only SQL that can produce composites of non-pre-determined types. For constructs producing named composite types, the limit on the number of columns in a table should take care of it. What I'm more troubled by is whether there are any ways to produce a wide tuple that don't come through either the parser or a table definition. Not sure what that could look like, other than C code randomly constructing a RowExpr or some such. regards, tom lane