postgres.git / summary / log / commit / refs

commit    1fd6ed1f8cf5e0e40d2c66ea0ac4788af757b937
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 523c14b38d8..59320552e21 100644 --- a/src/backend/statistics/dependencies.c +++ b/src/backend/statistics/dependencies.c @@ -1514,17 +1514,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: 85a38715894b]