Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> On 04/28/15 21:50, Tom Lane wrote:
>> RestrictInfo is not a general expression node and support for it has
>> been deliberately omitted from expression_tree_walker(). So I think
>> what you are proposing is a bad idea and probably a band-aid for some
>> other bad idea.
> That's not what I said, though. I said that calling pull_varnos() causes
> the issue - apparently that does not happen in master, but I ran into
> that when hacking on a patch.
pull_varnos is not, and should not be, applied to a RestrictInfo; for one
thing, it'd be redundant with work that was already done when creating the
RestrictInfo (cf make_restrictinfo_internal). You've not shown the
context of your problem very fully, but in general most code in the planner
should be well aware of whether it is working with a RestrictInfo (or list
of same) or a bare expression. I don't believe that it's a very good idea
to obscure that distinction.
regards, tom lane