postgresql/src/include/rewrite
Richard Guo 363a6e8c6f Eliminate code duplication in replace_rte_variables callbacks
The callback functions ReplaceVarsFromTargetList_callback and
pullup_replace_vars_callback are both used to replace Vars in an
expression tree that reference a particular RTE with items from a
targetlist, and they both need to expand whole-tuple references and
deal with OLD/NEW RETURNING list Vars.  As a result, currently there
is significant code duplication between these two functions.

This patch introduces a new function, ReplaceVarFromTargetList, to
perform the replacement and calls it from both callback functions,
thereby eliminating code duplication.

Author: Dean Rasheed <dean.a.rasheed@gmail.com>
Author: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: Jian He <jian.universality@gmail.com>
Discussion: https://postgr.es/m/CAEZATCWhr=FM4X5kCPvVs-g2XEk+ceLsNtBK_zZMkqFn9vUjsw@mail.gmail.com
2025-02-25 16:11:34 +09:00
..
prs2lock.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
rewriteDefine.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
rewriteHandler.h Expand virtual generated columns in the planner 2025-02-25 16:10:25 +09:00
rewriteManip.h Eliminate code duplication in replace_rte_variables callbacks 2025-02-25 16:11:34 +09:00
rewriteRemove.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
rewriteSearchCycle.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
rewriteSupport.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
rowsecurity.h Update copyright for 2025 2025-01-01 11:21:55 -05:00