diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-11-21 18:21:46 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-11-21 18:21:46 -0500 |
commit | 447770404cce5ce86174fa4809784c4e5d0a0a76 (patch) | |
tree | 286179c879751edbebffd9fe314c6878a0559edb /src/backend/nodes/outfuncs.c | |
parent | c2ea2285e978d9289084846a3343cef7d261d880 (diff) | |
download | postgresql-447770404cce5ce86174fa4809784c4e5d0a0a76.tar.gz postgresql-447770404cce5ce86174fa4809784c4e5d0a0a76.zip |
Rearrange CustomScan API.
Make it work more like FDW plans do: instead of assuming that there are
expressions in a CustomScan plan node that the core code doesn't know
about, insist that all subexpressions that need planner attention be in
a "custom_exprs" list in the Plan representation. (Of course, the
custom plugin can break the list apart again at executor initialization.)
This lets us revert the parts of the patch that exposed setrefs.c and
subselect.c processing to the outside world.
Also revert the GetSpecialCustomVar stuff in ruleutils.c; that concept
may work in future, but it's far from fully baked right now.
Diffstat (limited to 'src/backend/nodes/outfuncs.c')
-rw-r--r-- | src/backend/nodes/outfuncs.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index cdf1e7ece1f..ca9bd4f7c7f 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -569,10 +569,14 @@ _outCustomScan(StringInfo str, const CustomScan *node) WRITE_NODE_TYPE("CUSTOMSCAN"); _outScanInfo(str, (const Scan *) node); + WRITE_UINT_FIELD(flags); - appendStringInfo(str, " :methods"); + WRITE_NODE_FIELD(custom_exprs); + WRITE_NODE_FIELD(custom_private); + appendStringInfoString(str, " :methods "); _outToken(str, node->methods->CustomName); - node->methods->TextOutCustomScan(str, node); + if (node->methods->TextOutCustomScan) + node->methods->TextOutCustomScan(str, node); } static void @@ -1600,11 +1604,15 @@ static void _outCustomPath(StringInfo str, const CustomPath *node) { WRITE_NODE_TYPE("CUSTOMPATH"); + _outPathInfo(str, (const Path *) node); + WRITE_UINT_FIELD(flags); - appendStringInfo(str, " :methods"); + WRITE_NODE_FIELD(custom_private); + appendStringInfoString(str, " :methods "); _outToken(str, node->methods->CustomName); - node->methods->TextOutCustomPath(str, node); + if (node->methods->TextOutCustomPath) + node->methods->TextOutCustomPath(str, node); } static void |