mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +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:
@@ -597,6 +597,29 @@ _copyForeignScan(const ForeignScan *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/*
|
||||
* _copyCustomScan
|
||||
*/
|
||||
static CustomScan *
|
||||
_copyCustomScan(const CustomScan *from)
|
||||
{
|
||||
CustomScan *newnode;
|
||||
|
||||
newnode = from->methods->CopyCustomScan(from);
|
||||
Assert(nodeTag(newnode) == nodeTag(from));
|
||||
|
||||
CopyScanFields((const Scan *) from, (Scan *) newnode);
|
||||
COPY_SCALAR_FIELD(flags);
|
||||
/*
|
||||
* NOTE: The method field of CustomScan is required to be a pointer
|
||||
* to a static table of callback functions. So, we don't copy the
|
||||
* table itself, just reference the original one.
|
||||
*/
|
||||
COPY_SCALAR_FIELD(methods);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/*
|
||||
* CopyJoinFields
|
||||
*
|
||||
@@ -4043,6 +4066,9 @@ copyObject(const void *from)
|
||||
case T_ForeignScan:
|
||||
retval = _copyForeignScan(from);
|
||||
break;
|
||||
case T_CustomScan:
|
||||
retval = _copyCustomScan(from);
|
||||
break;
|
||||
case T_Join:
|
||||
retval = _copyJoin(from);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user