mirror of
https://github.com/postgres/postgres.git
synced 2025-07-18 17:42:25 +03:00
Introduce custom path and scan providers.
This allows extension modules to define their own methods for scanning a relation, and get the core code to use them. It's unclear as yet how much use this capability will find, but we won't find out if we never commit it. KaiGai Kohei, reviewed at various times and in various levels of detail by Shigeru Hanada, Tom Lane, Andres Freund, Álvaro Herrera, and myself.
This commit is contained in:
@ -563,6 +563,18 @@ _outForeignScan(StringInfo str, const ForeignScan *node)
|
||||
WRITE_BOOL_FIELD(fsSystemCol);
|
||||
}
|
||||
|
||||
static void
|
||||
_outCustomScan(StringInfo str, const CustomScan *node)
|
||||
{
|
||||
WRITE_NODE_TYPE("CUSTOMSCAN");
|
||||
|
||||
_outScanInfo(str, (const Scan *) node);
|
||||
WRITE_UINT_FIELD(flags);
|
||||
appendStringInfo(str, " :methods");
|
||||
_outToken(str, node->methods->CustomName);
|
||||
node->methods->TextOutCustomScan(str, node);
|
||||
}
|
||||
|
||||
static void
|
||||
_outJoin(StringInfo str, const Join *node)
|
||||
{
|
||||
@ -1584,6 +1596,17 @@ _outForeignPath(StringInfo str, const ForeignPath *node)
|
||||
WRITE_NODE_FIELD(fdw_private);
|
||||
}
|
||||
|
||||
static void
|
||||
_outCustomPath(StringInfo str, const CustomPath *node)
|
||||
{
|
||||
WRITE_NODE_TYPE("CUSTOMPATH");
|
||||
_outPathInfo(str, (const Path *) node);
|
||||
WRITE_UINT_FIELD(flags);
|
||||
appendStringInfo(str, " :methods");
|
||||
_outToken(str, node->methods->CustomName);
|
||||
node->methods->TextOutCustomPath(str, node);
|
||||
}
|
||||
|
||||
static void
|
||||
_outAppendPath(StringInfo str, const AppendPath *node)
|
||||
{
|
||||
@ -2855,6 +2878,9 @@ _outNode(StringInfo str, const void *obj)
|
||||
case T_ForeignScan:
|
||||
_outForeignScan(str, obj);
|
||||
break;
|
||||
case T_CustomScan:
|
||||
_outCustomScan(str, obj);
|
||||
break;
|
||||
case T_Join:
|
||||
_outJoin(str, obj);
|
||||
break;
|
||||
@ -3063,6 +3089,9 @@ _outNode(StringInfo str, const void *obj)
|
||||
case T_ForeignPath:
|
||||
_outForeignPath(str, obj);
|
||||
break;
|
||||
case T_CustomPath:
|
||||
_outCustomPath(str, obj);
|
||||
break;
|
||||
case T_AppendPath:
|
||||
_outAppendPath(str, obj);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user