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 1rctdn-002kGS-5h for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Feb 2024 20:56:31 +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 1rctdl-006UIk-NP for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Feb 2024 20:56:30 +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.94.2) (envelope-from ) id 1rctdl-006UIc-Cc for pgsql-bugs@lists.postgresql.org; Wed, 21 Feb 2024 20:56:29 +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.94.2) (envelope-from ) id 1rctdi-000K31-3V for pgsql-bugs@lists.postgresql.org; Wed, 21 Feb 2024 20:56:28 +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 41LKuOZV140974; Wed, 21 Feb 2024 15:56:24 -0500 From: Tom Lane To: Ed Herrmann cc: Laurenz Albe , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18356: Casting values from jsonb_each_text does not respect WHERE filter with sub select In-reply-to: References: <18356-a811d014209fd19c@postgresql.org> <2df3715aa60088b5d781c6b4b1dc1ec5ab62669b.camel@cybertec.at> <131235.1708547688@sss.pgh.pa.us> Comments: In-reply-to Ed Herrmann message dated "Wed, 21 Feb 2024 15:51:21 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <140972.1708548984.1@sss.pgh.pa.us> Date: Wed, 21 Feb 2024 15:56:24 -0500 Message-ID: <140973.1708548984@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ed Herrmann writes: > This example does not cause the same error and returns results as expected. > If it has to do with the execution plan as Laurenz suggested, do you have a > suggestion on how to better create a self-contained example where it would > behave more like an actual table select to get the desired list of keys? Do an EXPLAIN on the problem query, and then try to make an example with no private data that shows the same plan. regards, tom lane