Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf/6003~1
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/6003
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Aug 30, 2025

  1. Fix const-simplification for constraints and stats

    Constraint expressions and statistics expressions loaded from the
    system catalogs need to be run through const-simplification, because
    the planner will be comparing them to similarly-processed qual
    clauses.  Without this step, the planner may fail to detect valid
    matches.
    
    Currently, NullTest clauses in these expressions may not be reduced
    correctly during const-simplification.  This happens because their Var
    nodes do not yet have the correct varno when eval_const_expressions is
    applied.  Since eval_const_expressions relies on varno to reduce
    NullTest quals, incorrect varno can cause problems.
    
    Additionally, for statistics expressions, eval_const_expressions is
    called with root set to NULL, which also inhibits NullTest reduction.
    
    This patch fixes the issue by ensuring that Vars are updated to have
    the correct varno before const-simplification, and that a valid root
    is passed to eval_const_expressions when needed.
    
    Author: Richard Guo <[email protected]>
    Discussion: https://postgr.es/m/[email protected]
    Richard Guo committed Aug 30, 2025
    Configuration menu
    Copy the full SHA
    317c117 View commit details
    Browse the repository at this point in the history
Loading