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 1sjpAk-004QH1-Uk for pgsql-general@arkaria.postgresql.org; Fri, 30 Aug 2024 00:07:26 +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 1sjpAi-00A8K8-Mg for pgsql-general@arkaria.postgresql.org; Fri, 30 Aug 2024 00:07:25 +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 1sjpAi-00A8K0-Bo for pgsql-general@lists.postgresql.org; Fri, 30 Aug 2024 00:07:24 +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 1sjpAc-0025lv-EE for pgsql-general@lists.postgresql.org; Fri, 30 Aug 2024 00:07:23 +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 47U07Dpg317221; Thu, 29 Aug 2024 20:07:13 -0400 From: Tom Lane To: Rumpi Gravenstein cc: PostgreSQL Subject: Re: Analytic Function Bug In-reply-to: References: Comments: In-reply-to Rumpi Gravenstein message dated "Thu, 29 Aug 2024 19:18:16 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <317219.1724976433.1@sss.pgh.pa.us> Date: Thu, 29 Aug 2024 20:07:13 -0400 Message-ID: <317220.1724976433@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Rumpi Gravenstein writes: > Is this a PostgreSQL bug? Maybe, but you haven't provided enough information to let anyone else reproduce the behavior. Personally I'm suspicious that because your lag() calls are over partition by p.logical_partition_key, p.txt order by indx but then you filter by where logical_partition_key='TEST_DATA' and usage_text='F(T61)(EXPORT)'; that the lag() functions are seeing some rows that don't show up in the final output. (This'd require that some output rows from "parse" share txt values but not usage_text values, but that certainly looks like it's possible.) So IMO you have not actually demonstrated that there is any bug. regards, tom lane