postgres.git / summary / log / commit / refs
commit 2a99622bfc01a61e883be573a12d1b52b8f38bcf
Author: David Rowley <drowley@postgresql.org>
Date: Fri Oct 30 02:27:09 2026 +0000
First released in: 14.25, 15.20, 16.16, 17.12, 18.7, 19.0
Remove unwarranted Assert in dependencies_clauselist_selectivity()
The loop above from where the Assert is removed handles assigning the same
attnum to any duplicate expressions, so asserting there are no duplicate
attnums just after purposefully making duplicate ones isn't the correct
thing to do.
The Assert was added by a4d75c86bf, so backpatch to v14
Author: BHUVAN CHILUKUTI <c.bhuvan@iitg.ac.in>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/PN0P287MB0903563C70D8E5B81912E855A7602@PN0P287MB0903.INDP287.PROD.OUTLOOK.COM
Backpatch-through: 14
src/backend/statistics/dependencies.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/src/backend/statistics/dependencies.c b/src/backend/statistics/dependencies.c
index 85e56d10282..f5c13354bda 100644
--- a/src/backend/statistics/dependencies.c
+++ b/src/backend/statistics/dependencies.c
@@ -1526,17 +1526,6 @@ dependencies_clauselist_selectivity(PlannerInfo *root,
/* make sure the attnum is positive (valid AttrNumber) */
attnum = list_attnums[i] + attnum_offset;
- /*
- * Either it's a regular attribute, or it's an expression, in which
- * case we must not have seen it before (expressions are unique).
- *
- * XXX Check whether it's a regular attribute has to be done using the
- * original attnum, while the second check has to use the value with
- * an offset.
- */
- Assert(AttrNumberIsForUserDefinedAttr(list_attnums[i]) ||
- !bms_is_member(attnum, clauses_attnums));
-
/*
* Remember the offset attnum, both for attributes and expressions.
* We'll pass list_attnums to clauselist_apply_dependencies, which
[parent: b0fa692801d1]