Re: Handling RestrictInfo in expression_tree_walker - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Handling RestrictInfo in expression_tree_walker
Date
Msg-id 2695.1565192851@sss.pgh.pa.us
Whole thread Raw
In response to Re: Handling RestrictInfo in expression_tree_walker  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
List pgsql-hackers
Konstantin Knizhnik <k.knizhnik@postgrespro.ru> writes:
> Frankly speaking I do not see some good reasons for not handling 
> RestrictInfo in expression_tree_worker. It can really simplify writing 
> of mutators/walkers.

I don't buy this; what seems more likely is that you're trying to apply
an expression tree mutator to something you shouldn't.  The caching
aspects of RestrictInfo, and the fact that the planner often assumes
that RestrictInfos don't get copied (so that pointer equality is a
useful test), are both good reasons to be wary of applying general
mutations to those nodes.

Or in other words, if you want a walker/mutator to descend through
those nodes, you almost certainly need special logic at those nodes
anyway.  Omitting them from the nodeFuncs support guarantees you
don't forget that.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Sehrope Sarkuni
Date:
Subject: Re: [Proposal] Table-level Transparent Data Encryption (TDE) and KeyManagement Service (KMS)
Next
From: Tom Lane
Date:
Subject: Re: s/rewinded/rewound/?