Thread: pgsql: Initial code review for CustomScan patch.

pgsql: Initial code review for CustomScan patch.

From
Tom Lane
Date:
Initial code review for CustomScan patch.

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a34fa8ee7cc757671632dc4dcae4f21e8f2e2357

Modified Files
--------------
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(-)