|
typedef void(* | GetForeignRelSize_function) (PlannerInfo *root, RelOptInfo *baserel, Oid foreigntableid) |
|
typedef void(* | GetForeignPaths_function) (PlannerInfo *root, RelOptInfo *baserel, Oid foreigntableid) |
|
typedef ForeignScan *(* | GetForeignPlan_function) (PlannerInfo *root, RelOptInfo *baserel, Oid foreigntableid, ForeignPath *best_path, List *tlist, List *scan_clauses, Plan *outer_plan) |
|
typedef void(* | BeginForeignScan_function) (ForeignScanState *node, int eflags) |
|
typedef TupleTableSlot *(* | IterateForeignScan_function) (ForeignScanState *node) |
|
typedef bool(* | RecheckForeignScan_function) (ForeignScanState *node, TupleTableSlot *slot) |
|
typedef void(* | ReScanForeignScan_function) (ForeignScanState *node) |
|
typedef void(* | EndForeignScan_function) (ForeignScanState *node) |
|
typedef void(* | GetForeignJoinPaths_function) (PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel, JoinType jointype, JoinPathExtraData *extra) |
|
typedef void(* | GetForeignUpperPaths_function) (PlannerInfo *root, UpperRelationKind stage, RelOptInfo *input_rel, RelOptInfo *output_rel, void *extra) |
|
typedef void(* | AddForeignUpdateTargets_function) (PlannerInfo *root, Index rtindex, RangeTblEntry *target_rte, Relation target_relation) |
|
typedef List *(* | PlanForeignModify_function) (PlannerInfo *root, ModifyTable *plan, Index resultRelation, int subplan_index) |
|
typedef void(* | BeginForeignModify_function) (ModifyTableState *mtstate, ResultRelInfo *rinfo, List *fdw_private, int subplan_index, int eflags) |
|
typedef TupleTableSlot *(* | ExecForeignInsert_function) (EState *estate, ResultRelInfo *rinfo, TupleTableSlot *slot, TupleTableSlot *planSlot) |
|
typedef TupleTableSlot **(* | ExecForeignBatchInsert_function) (EState *estate, ResultRelInfo *rinfo, TupleTableSlot **slots, TupleTableSlot **planSlots, int *numSlots) |
|
typedef int(* | GetForeignModifyBatchSize_function) (ResultRelInfo *rinfo) |
|
typedef TupleTableSlot *(* | ExecForeignUpdate_function) (EState *estate, ResultRelInfo *rinfo, TupleTableSlot *slot, TupleTableSlot *planSlot) |
|
typedef TupleTableSlot *(* | ExecForeignDelete_function) (EState *estate, ResultRelInfo *rinfo, TupleTableSlot *slot, TupleTableSlot *planSlot) |
|
typedef void(* | EndForeignModify_function) (EState *estate, ResultRelInfo *rinfo) |
|
typedef void(* | BeginForeignInsert_function) (ModifyTableState *mtstate, ResultRelInfo *rinfo) |
|
typedef void(* | EndForeignInsert_function) (EState *estate, ResultRelInfo *rinfo) |
|
typedef int(* | IsForeignRelUpdatable_function) (Relation rel) |
|
typedef bool(* | PlanDirectModify_function) (PlannerInfo *root, ModifyTable *plan, Index resultRelation, int subplan_index) |
|
typedef void(* | BeginDirectModify_function) (ForeignScanState *node, int eflags) |
|
typedef TupleTableSlot *(* | IterateDirectModify_function) (ForeignScanState *node) |
|
typedef void(* | EndDirectModify_function) (ForeignScanState *node) |
|
typedef RowMarkType(* | GetForeignRowMarkType_function) (RangeTblEntry *rte, LockClauseStrength strength) |
|
typedef void(* | RefetchForeignRow_function) (EState *estate, ExecRowMark *erm, Datum rowid, TupleTableSlot *slot, bool *updated) |
|
typedef void(* | ExplainForeignScan_function) (ForeignScanState *node, struct ExplainState *es) |
|
typedef void(* | ExplainForeignModify_function) (ModifyTableState *mtstate, ResultRelInfo *rinfo, List *fdw_private, int subplan_index, struct ExplainState *es) |
|
typedef void(* | ExplainDirectModify_function) (ForeignScanState *node, struct ExplainState *es) |
|
typedef int(* | AcquireSampleRowsFunc) (Relation relation, int elevel, HeapTuple *rows, int targrows, double *totalrows, double *totaldeadrows) |
|
typedef bool(* | AnalyzeForeignTable_function) (Relation relation, AcquireSampleRowsFunc *func, BlockNumber *totalpages) |
|
typedef List *(* | ImportForeignSchema_function) (ImportForeignSchemaStmt *stmt, Oid serverOid) |
|
typedef void(* | ExecForeignTruncate_function) (List *rels, DropBehavior behavior, bool restart_seqs) |
|
typedef Size(* | EstimateDSMForeignScan_function) (ForeignScanState *node, ParallelContext *pcxt) |
|
typedef void(* | InitializeDSMForeignScan_function) (ForeignScanState *node, ParallelContext *pcxt, void *coordinate) |
|
typedef void(* | ReInitializeDSMForeignScan_function) (ForeignScanState *node, ParallelContext *pcxt, void *coordinate) |
|
typedef void(* | InitializeWorkerForeignScan_function) (ForeignScanState *node, shm_toc *toc, void *coordinate) |
|
typedef void(* | ShutdownForeignScan_function) (ForeignScanState *node) |
|
typedef bool(* | IsForeignScanParallelSafe_function) (PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) |
|
typedef List *(* | ReparameterizeForeignPathByChild_function) (PlannerInfo *root, List *fdw_private, RelOptInfo *child_rel) |
|
typedef bool(* | IsForeignPathAsyncCapable_function) (ForeignPath *path) |
|
typedef void(* | ForeignAsyncRequest_function) (AsyncRequest *areq) |
|
typedef void(* | ForeignAsyncConfigureWait_function) (AsyncRequest *areq) |
|
typedef void(* | ForeignAsyncNotify_function) (AsyncRequest *areq) |
|
typedef struct FdwRoutine | FdwRoutine |
|
Definition at line 742 of file foreign.c.
743{
745
747
749 {
752
753
754 if (path->param_info != NULL)
755 continue;
756
758 {
759 case T_HashJoin:
760 {
762
763 memcpy(hash_path, path,
sizeof(
HashPath));
765 }
766 break;
767
768 case T_NestLoop:
769 {
771
772 memcpy(nest_path, path,
sizeof(
NestPath));
774 }
775 break;
776
777 case T_MergeJoin:
778 {
780
781 memcpy(merge_path, path,
sizeof(
MergePath));
783 }
784 break;
785
786 default:
787
788
789
790
791
792
793 break;
794 }
795
796
797 if (!joinpath)
798 continue;
799
800
801
802
803
804
805
807 {
809
812 {
814
815 if (joinpath->path.pathtype == T_MergeJoin)
816 {
818
819
820
821
822
828 }
829 }
830 }
831
833 {
835
838 {
840
841 if (joinpath->path.pathtype == T_MergeJoin)
842 {
844
845
846
847
848
853 }
854 }
855 }
856
857 return (
Path *) joinpath;
858 }
859 return NULL;
860}
Assert(PointerIsAligned(start, uint64))
if(TABLE==NULL||TABLE_index==NULL)
#define IsA(nodeptr, _type_)
bool pathkeys_count_contained_in(List *keys1, List *keys2, int *n_common)
bool pathkeys_contained_in(List *keys1, List *keys2)
References Assert(), ForeignPath::fdw_outerpath, if(), JoinPath::innerjoinpath, MergePath::innersortkeys, IS_JOIN_REL, IsA, lfirst, makeNode, NIL, MergePath::outer_presorted_keys, JoinPath::outerjoinpath, MergePath::outersortkeys, ForeignPath::path, Path::pathkeys, pathkeys_contained_in(), pathkeys_count_contained_in(), RelOptInfo::pathlist, and Path::pathtype.
Referenced by postgresGetForeignJoinPaths().
Definition at line 378 of file foreign.c.
379{
385
386
389 elog(
ERROR,
"cache lookup failed for foreign server %u", serverid);
391 fdwid = serverform->srvfdw;
393
394
397 elog(
ERROR,
"cache lookup failed for foreign-data wrapper %u", fdwid);
399 fdwhandler = fdwform->fdwhandler;
400
401
404 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
405 errmsg(
"foreign-data wrapper \"%s\" has no handler",
407
409
410
412}
#define OidIsValid(objectId)
FdwRoutine * GetFdwRoutine(Oid fdwhandler)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
FormData_pg_foreign_data_wrapper * Form_pg_foreign_data_wrapper
FormData_pg_foreign_server * Form_pg_foreign_server
static Datum ObjectIdGetDatum(Oid X)
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
References elog, ereport, errcode(), errmsg(), ERROR, GetFdwRoutine(), GETSTRUCT(), HeapTupleIsValid, NameStr, ObjectIdGetDatum(), OidIsValid, ReleaseSysCache(), and SearchSysCache1().
Referenced by ExecInitForeignScan(), ExecuteTruncateGuts(), GetFdwRoutineByRelId(), and truncate_check_rel().