Re: BUG #18608: Assert in check_agglevels_and_constraints() fails on creating a rule with aggr(NEW) in subselect

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Date: 2024-09-10T19:06:20Z
Lists: pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> 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



Commits

  1. Remove incorrect Assert.