1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-18 17:42:25 +03:00

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.
This commit is contained in:
Tom Lane
2014-11-21 18:21:46 -05:00
parent c2ea2285e9
commit 447770404c
11 changed files with 109 additions and 164 deletions

View File

@ -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