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 1pXl3c-0006dY-Qm for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Mar 2023 15:41:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pXl3b-00010U-Bu for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Mar 2023 15:41:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXl3b-00010J-3g for pgsql-bugs@lists.postgresql.org; Thu, 02 Mar 2023 15:41:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXl3Z-0002Yi-1k for pgsql-bugs@lists.postgresql.org; Thu, 02 Mar 2023 15:41:22 +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 322FfHVk1905387; Thu, 2 Mar 2023 10:41:17 -0500 From: Tom Lane To: cute_hoay88@hotmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17818: CTE is not returning the right data. In-reply-to: <17818-2ef0f7567df79f09@postgresql.org> References: <17818-2ef0f7567df79f09@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 02 Mar 2023 08:33:51 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1905385.1677771677.1@sss.pgh.pa.us> Date: Thu, 02 Mar 2023 10:41:17 -0500 Message-ID: <1905386.1677771677@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > PostgreSQL version: 12.1 > Scenario: When i execute this above query, i am not able to find the feature > AA and Item AA EXT Inner-Lane- 1.1G. > But weird is i tried out with this (below example: Add WHERE inside the > cte), then i am able to get the item: I agree that's strange, but ... > Can you please help to investigate and explain what is the possible root > cause for this? Nobody is going to be able to help you from that amount of information. I would suggest, if you really are running 12.1, that your first step should be to update to 12.latest (currently 12.14), as you are missing more than three years worth of bug fixes. Another useful step could be to re-index these tables, just in case the problem is index corruption. (Do that *after* updating.) If you still see strange behavior, and can provide a self-contained test case, we'd be happy to look at it. regards, tom lane