]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Remove unnecessary code in dependency_is_compatible_expression().
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 14 Mar 2023 15:10:45 +0000 (11:10 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 14 Mar 2023 15:10:45 +0000 (11:10 -0400)
commit3b459444301c4c40e8d978ef6025c7177c85c017
treed7131b5ae1af7cc6469d6273cf23b1871eea3441
parent74a1a36d755bf5a5c656d78ef7f1df1cfeeeeb20
Remove unnecessary code in dependency_is_compatible_expression().

Scanning the expression for compatible Vars isn't really necessary,
because the subsequent match against StatisticExtInfo entries will
eliminate expressions containing other Vars just fine.  Moreover,
this code hadn't stopped to think about what to do with
PlaceHolderVars or Aggrefs in the clause; and at least for the PHV
case, that demonstrably leads to failures.  Rather than work out
whether it's reasonable to ignore those, let's just remove the
whole stanza.

Per report from Richard Guo.  Back-patch to v14 where this code
was added.

Discussion: https://postgr.es/m/CAMbWs48Mmvm-acGevXuwpB=g5JMqVSL6i9z5UaJyLGJqa-XPAA@mail.gmail.com
src/backend/statistics/dependencies.c