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 1ruOhG-0057jl-QP for pgsql-bugs@arkaria.postgresql.org; Wed, 10 Apr 2024 03:32:27 +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 1ruOhF-00El0m-PS for pgsql-bugs@arkaria.postgresql.org; Wed, 10 Apr 2024 03:32:25 +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 1ruOhF-00El0e-HF for pgsql-bugs@lists.postgresql.org; Wed, 10 Apr 2024 03:32:25 +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.94.2) (envelope-from ) id 1ruOh9-0008A5-VN for pgsql-bugs@lists.postgresql.org; Wed, 10 Apr 2024 03:32:24 +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 43A3WHX23917909; Tue, 9 Apr 2024 23:32:17 -0400 From: Tom Lane To: Richard Guo cc: Tender Wang , exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18422: Assert in expandTupleDesc() fails on row mismatch with additional SRF In-reply-to: References: <18422-89ca86c8eac5246d@postgresql.org> <3861246.1712691263@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Wed, 10 Apr 2024 11:25:22 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3917907.1712719937.1@sss.pgh.pa.us> Date: Tue, 09 Apr 2024 23:32:17 -0400 Message-ID: <3917908.1712719937@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > I wonder why the v2 patch does not apply this same rule in > process_function_rte_ref(), by checking if the 'rtfunc' has a coldeflist > before it calls get_expr_result_tupdesc. I guess we could. It won't matter because the following code will reject RECORD in any case; but we could save a few cycles by not calling get_expr_result_tupdesc there. regards, tom lane