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.98.2) (envelope-from ) id 1xDF0B-00000000Ogc-0y8X for pgsql-bugs@arkaria.postgresql.org; Sun, 04 Oct 2026 05:43:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xDF09-000000045m7-1GW7 for pgsql-bugs@arkaria.postgresql.org; Sun, 04 Oct 2026 05:43:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xDF09-000000045lz-0D2n for pgsql-bugs@lists.postgresql.org; Sun, 04 Oct 2026 05:43:09 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xDF07-00000000GbZ-0yCB for pgsql-bugs@lists.postgresql.org; Sun, 04 Oct 2026 05:43:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 6945gwIK290583; Sun, 4 Oct 2026 01:42:58 -0400 From: Tom Lane To: David Rowley cc: feasiblechart@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19742: `INTERSECT` under a `UNION ALL` with an empty arm fails with "could not find pathkey item t" In-reply-to: References: <19742-dc403ca277cad1d3@postgresql.org> <261146.1791064428@sss.pgh.pa.us> <273647.1791075609@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Sun, 04 Oct 2026 18:37:29 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <290581.1791092578.1@sss.pgh.pa.us> Date: Sun, 04 Oct 2026 01:42:58 -0400 Message-ID: <290582.1791092578@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > I think the fix needs to be either don't remove redundant pathkeys for > setop_pathkeys or use some other method to figure out which > expressions to add in add_child_eq_member(). My own thoughts were along the lines of "don't ever assign pathkeys to an AppendPath"; not sure if that's equivalent to your first idea. In the long run I'd like to get rid of the varno-zero business in favor of some less-magic representation; but that's clearly not reasonable for v19. regards, tom lane