Thread
Commits
-
Remove incorrect Assert.
- 2be0e863204e 12.21 landed
- abed06fdc5b2 13.17 landed
- 14bb709b27fe 14.14 landed
- 78d0bd452c78 15.9 landed
- f3336626d2e3 16.5 landed
- 7f88e50b455d 17.0 landed
- 77761ee5dddc 18.0 landed
-
BUG #18608: Assert in check_agglevels_and_constraints() fails on creating a rule with aggr(NEW) in subselect
The Post Office <noreply@postgresql.org> — 2024-09-10T18:00:01Z
The following bug has been logged on the website: Bug reference: 18608 Logged by: Alexander Lakhin Email address: exclusion@gmail.com PostgreSQL version: 17rc1 Operating system: Ubuntu 22.04 Description: The following script: CREATE TABLE t (a int); CREATE VIEW v AS SELECT 1; CREATE RULE v_ins AS ON INSERT TO v DO INSTEAD INSERT INTO t SELECT * FROM (SELECT count(NEW) FROM t); 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 Reproduced on REL_9_3_STABLE .. master. -
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> — 2024-09-10T19:06:20Z
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