Database Reference
In-Depth Information
The foreign data wrapper machinery will not call any function whose pointer is null.
This can be seen in the following example:
FdwRoutine *dummy_fdw_handler(PG_FUNCTION_ARGS)
{
FdwRoutine *fdwroutine = makeNode (FdwRoutine);
/* Callback functions for readable FDW */
fdwroutine->GetForeignRelSize = dummyGetForeignRelSize;
fdwroutine->GetForeignPaths = dummyGetForeignPaths;
fdwroutine->AnalyzeForeignTable = dummyAnalyzeForeignTable;
fdwroutine->GetForeignPlan = dummyGetForeignPlan;
fdwroutine->ExplainForeignScan = dummyExplainForeignScan;
fdwroutine->BeginForeignScan = dummyBeginForeignScan;
fdwroutine->IterateForeignScan = dummyIterateForeignScan;
fdwroutine->ReScanForeignScan = dummyReScanForeignScan;
fdwroutine->EndForeignScan = dummyEndForeignScan;
/* Callback functions for writeable FDW */
fdwroutine->ExecForeignInsert = dummyExecForeignInsert;
fdwroutine->BeginForeignModify = dummyBeginForeignModify;
fdwroutine->PlanForeignModify = dummyPlanForeignModify;
fdwroutine->AddForeignUpdateTargets =
dummyAddForeignUpdateTargets;
fdwroutine->ExecForeignUpdate = dummyExecForeignUpdate;
fdwroutine->ExecForeignDelete = dummyExecForeignDelete;
fdwroutine->EndForeignModify = dummyEndForeignModify;
PG_RETURN_POINTER(fdwroutine);
}
Another important thing is a validator function that is responsible for validation of
the CREATE SERVER , CREATE USER MAPPING , and CREATE FOREIGN TABLE options.
Its syntax is as follows:
Datum dummy_fdw_validator(PG_FUNCTION_ARGS)
{
}
 
Search WWH ::




Custom Search