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 1tNfgW-001Lha-Q9 for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Dec 2024 22:04:57 +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 1tNfgV-006sU4-UG for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Dec 2024 22:04:55 +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 1tNfgV-006sSF-KG for pgsql-hackers@lists.postgresql.org; Tue, 17 Dec 2024 22:04:55 +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 1tNfgS-000IOt-5O for pgsql-hackers@postgresql.org; Tue, 17 Dec 2024 22:04:54 +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 4BHM4ntx2493002; Tue, 17 Dec 2024 17:04:49 -0500 From: Tom Lane To: David Rowley cc: Nathan Bossart , Paul Ramsey , PostgreSQL Hackers Subject: Re: Pg18 Recursive Crash In-reply-to: References: <99F064C1-B3EB-4BE7-97D2-D2A0AA487A71@cleverelephant.ca> Comments: In-reply-to David Rowley message dated "Wed, 18 Dec 2024 10:58:37 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2493000.1734473089.1@sss.pgh.pa.us> Date: Tue, 17 Dec 2024 17:04:49 -0500 Message-ID: <2493001.1734473089@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > The slightly annoying thing here is that the attached patch passes the > TupleTableSlotOps as NULL in nodeSetOp.c. Per nodeAppend.c line 186, > Append does not go to much effort to setting a fixed > TupleTableSlotOps. Really it could loop over all the child plans and > check if those have fixed slot types of the same type and then fix its > own resulting slot. For nodeSetOps.c use case, since the planner > (currently) injects the flag into the target list, it'll always > project and use a virtual slot type. It's maybe worth coming back and > adjusting nodeAppend.c so it works a bit harder to fix its slot type. > I think that's likely for another patch, however. Tom is also > currently working on nodeSetOps.c to change how all this works so it > no longer uses the flags method to determine the outer and inner > sides. Yeah, I see no point in putting effort into improving the current nodeSetOp implementation. There might be a reason to change nodeAppend as you suggest for other use-cases though. > I plan to push the attached patch soon. I'll presumably need to rebase my nodeSetOp patch when this goes in. I'll take a look then at whether the new code can be improved with this additional feature. regards, tom lane