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 1so6C5-008I1y-Ta for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Sep 2024 19:06:30 +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 1so6C4-000dwr-Iw for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Sep 2024 19:06:28 +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 1so6C4-000duj-9y for pgsql-bugs@lists.postgresql.org; Tue, 10 Sep 2024 19:06:28 +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 1so6Bx-000Vfb-Kw for pgsql-bugs@lists.postgresql.org; Tue, 10 Sep 2024 19:06:27 +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 48AJ6KPr3543321; Tue, 10 Sep 2024 15:06:20 -0400 From: Tom Lane To: exclusion@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18608: Assert in check_agglevels_and_constraints() fails on creating a rule with aggr(NEW) in subselect In-reply-to: <18608-48de0717508ee429@postgresql.org> References: <18608-48de0717508ee429@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 10 Sep 2024 18:00:01 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3543319.1725995180.1@sss.pgh.pa.us> Date: Tue, 10 Sep 2024 15:06:20 -0400 Message-ID: <3543320.1725995180@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: > [ NEW reference confuses check_agglevels_and_constraints ] > triggers an assertion failure: > TRAP: failed Assert("pstate->p_lateral_active"), File: "parse_agg.c", Line: > 385, PID: 2785906 > Without asserts enabled, it fails with: > ERROR: aggregate functions are not allowed in FROM clause of their own > query level Interesting. I'm inclined to just remove the Assert, since it's evidently wrong and the ensuing error seems sufficiently on-point. regards, tom lane