Initial code review for CustomScan patch

Enterprise / PostgreSQL - Tom Lane [sss.pgh.pa.us] - 20 November 2014 17:36 UTC

Get rid of the pernicious entanglement between planner and executor headers introduced by commit 0b03e5951bf0a1a8868db13f02049cf686a82165.

Also, rearrange the CustomFoo struct/typedef definitions so that all the typedef names are seen as used by the compiler. Without this pgindent will mess things up a bit, which is not so important perhaps, but it also removes a bizarre discrepancy between the declaration arrangement used for CustomExecMethods and that used for CustomScanMethods and CustomPathMethods.

Clean up the commentary around ExecSupportsMarkRestore to reflect the rather large change in its API.

Const-ify register_custom_path_provider's argument. This necessitates casting away const in the function, but that seems better than forcing callers of the function to do so (or else not const-ify their method pointer structs, which was sort of the whole point).

De-export fix_expr_common. I don't like the exporting of fix_scan_expr or replace_nestloop_params either, but this one surely has got little excuse.

a34fa8e Initial code review for CustomScan patch.
src/backend/executor/execAmi.c | 44 +++++++-------
src/backend/optimizer/plan/createplan.c | 97 ++++++++++++++++---------------
src/backend/optimizer/plan/setrefs.c | 13 +++--
src/backend/optimizer/util/pathnode.c | 15 ++---
src/include/executor/executor.h | 5 +-
src/include/executor/nodeCustom.h | 6 +-
src/include/nodes/execnodes.h | 49 ++++++++--------
src/include/nodes/plannodes.h | 44 +++++++-------
src/include/nodes/relation.h | 38 ++++++------
src/include/optimizer/pathnode.h | 6 +-
src/include/optimizer/planmain.h | 3 +-
11 files changed, 164 insertions(+), 156 deletions(-)

Upstream: git.postgresql.org


  • Share