1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* executor.h--
|
1997-09-07 07:04:48 +02:00
|
|
|
* support for the POSTGRES executor module
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
1997-09-08 04:41:22 +02:00
|
|
|
* $Id: executor.h,v 1.12 1997/09/08 02:36:17 momjian Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef EXECUTOR_H
|
|
|
|
#define EXECUTOR_H
|
|
|
|
|
1996-11-05 09:18:44 +01:00
|
|
|
#include <catalog/pg_index.h>
|
|
|
|
#include <access/itup.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <executor/execdesc.h>
|
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
/* ----------------------------------------------------------------
|
|
|
|
* ----------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
1996-11-03 13:13:35 +01:00
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
/*
|
|
|
|
* prototypes from functions in execAmi.c
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
extern void
|
|
|
|
ExecOpenScanR(Oid relOid, int nkeys, ScanKey skeys, bool isindex,
|
|
|
|
ScanDirection dir, TimeQual timeRange,
|
|
|
|
Relation * returnRelation, Pointer * returnScanDesc);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void ExecCloseR(Plan * node);
|
|
|
|
extern void ExecReScan(Plan * node, ExprContext * exprCtxt, Plan * parent);
|
|
|
|
extern HeapScanDesc
|
1997-09-07 07:04:48 +02:00
|
|
|
ExecReScanR(Relation relDesc, HeapScanDesc scanDesc,
|
|
|
|
ScanDirection direction, int nkeys, ScanKey skeys);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void ExecMarkPos(Plan * node);
|
|
|
|
extern void ExecRestrPos(Plan * node);
|
1996-07-09 08:22:35 +02:00
|
|
|
extern Relation ExecCreatR(TupleDesc tupType, Oid relationOid);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* prototypes from functions in execJunk.c
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
extern JunkFilter *ExecInitJunkFilter(List * targetList);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern bool
|
1997-09-07 07:04:48 +02:00
|
|
|
ExecGetJunkAttribute(JunkFilter * junkfilter, TupleTableSlot * slot,
|
|
|
|
char *attrName, Datum * value, bool * isNull);
|
|
|
|
extern HeapTuple ExecRemoveJunk(JunkFilter * junkfilter, TupleTableSlot * slot);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* prototypes from functions in execMain.c
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
extern TupleDesc ExecutorStart(QueryDesc * queryDesc, EState * estate);
|
|
|
|
extern TupleTableSlot *ExecutorRun(QueryDesc * queryDesc, EState * estate, int feature, int count);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void ExecutorEnd(QueryDesc * queryDesc, EState * estate);
|
1997-09-07 07:04:48 +02:00
|
|
|
extern HeapTuple ExecConstraints(char *caller, Relation rel, HeapTuple tuple);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* prototypes from functions in execProcnode.c
|
|
|
|
*/
|
1997-09-08 04:41:22 +02:00
|
|
|
extern bool ExecInitNode(Plan * node, EState * estate, Plan * parent);
|
1997-09-07 07:04:48 +02:00
|
|
|
extern TupleTableSlot *ExecProcNode(Plan * node, Plan * parent);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern int ExecCountSlotsNode(Plan * node);
|
|
|
|
extern void ExecEndNode(Plan * node, Plan * parent);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* prototypes from functions in execQual.c
|
|
|
|
*/
|
1997-09-08 04:41:22 +02:00
|
|
|
extern bool execConstByVal;
|
|
|
|
extern int execConstLen;
|
1997-09-07 07:04:48 +02:00
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
extern Datum
|
1997-09-07 07:04:48 +02:00
|
|
|
ExecExtractResult(TupleTableSlot * slot, AttrNumber attnum,
|
|
|
|
bool * isNull);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern Datum
|
1997-09-07 07:04:48 +02:00
|
|
|
ExecEvalParam(Param * expression, ExprContext * econtext,
|
|
|
|
bool * isNull);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/* stop here */
|
1997-09-08 04:41:22 +02:00
|
|
|
extern char *
|
1997-09-07 07:04:48 +02:00
|
|
|
GetAttributeByName(TupleTableSlot * slot, char *attname,
|
|
|
|
bool * isNull);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern Datum
|
1997-09-07 07:04:48 +02:00
|
|
|
ExecEvalExpr(Node * expression, ExprContext * econtext, bool * isNull,
|
|
|
|
bool * isDone);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern bool ExecQual(List * qual, ExprContext * econtext);
|
|
|
|
extern int ExecTargetListLength(List * targetlist);
|
1997-09-07 07:04:48 +02:00
|
|
|
extern TupleTableSlot *ExecProject(ProjectionInfo * projInfo, bool * isDone);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* prototypes from functions in execScan.c
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
extern TupleTableSlot *ExecScan(Scan * node, TupleTableSlot * (*accessMtd) ());
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* prototypes from functions in execTuples.c
|
|
|
|
*/
|
|
|
|
extern TupleTable ExecCreateTupleTable(int initialSize);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void ExecDestroyTupleTable(TupleTable table, bool shouldFree);
|
1997-09-07 07:04:48 +02:00
|
|
|
extern TupleTableSlot *ExecAllocTableSlot(TupleTable table);
|
|
|
|
extern TupleTableSlot *
|
|
|
|
ExecStoreTuple(HeapTuple tuple,
|
|
|
|
TupleTableSlot * slot,
|
|
|
|
Buffer buffer,
|
|
|
|
bool shouldFree);
|
|
|
|
extern TupleTableSlot *ExecClearTuple(TupleTableSlot * slot);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern bool ExecSetSlotPolicy(TupleTableSlot * slot, bool shouldFree);
|
|
|
|
extern TupleDesc
|
1997-09-07 07:04:48 +02:00
|
|
|
ExecSetSlotDescriptor(TupleTableSlot * slot,
|
|
|
|
TupleDesc tupdesc);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void ExecSetSlotDescriptorIsNew(TupleTableSlot * slot, bool isNew);
|
|
|
|
extern void ExecIncrSlotBufferRefcnt(TupleTableSlot * slot);
|
|
|
|
extern bool TupIsNull(TupleTableSlot * slot);
|
|
|
|
extern void ExecInitResultTupleSlot(EState * estate, CommonState * commonstate);
|
1997-09-07 07:04:48 +02:00
|
|
|
extern void
|
|
|
|
ExecInitScanTupleSlot(EState * estate,
|
|
|
|
CommonScanState * commonscanstate);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void ExecInitMarkedTupleSlot(EState * estate, MergeJoinState * mergestate);
|
|
|
|
extern void ExecInitOuterTupleSlot(EState * estate, HashJoinState * hashstate);
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
extern TupleDesc ExecGetTupType(Plan * node);
|
|
|
|
extern TupleDesc ExecTypeFromTL(List * targetList);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* prototypes from functions in execTuples.c
|
|
|
|
*/
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void ResetTupleCount(void);
|
1997-09-07 07:04:48 +02:00
|
|
|
extern void
|
|
|
|
ExecAssignNodeBaseInfo(EState * estate, CommonState * basenode,
|
|
|
|
Plan * parent);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void ExecAssignExprContext(EState * estate, CommonState * commonstate);
|
1997-09-07 07:04:48 +02:00
|
|
|
extern void
|
|
|
|
ExecAssignResultType(CommonState * commonstate,
|
|
|
|
TupleDesc tupDesc);
|
|
|
|
extern void
|
|
|
|
ExecAssignResultTypeFromOuterPlan(Plan * node,
|
|
|
|
CommonState * commonstate);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void ExecAssignResultTypeFromTL(Plan * node, CommonState * commonstate);
|
1997-09-07 07:04:48 +02:00
|
|
|
extern TupleDesc ExecGetResultType(CommonState * commonstate);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void ExecAssignProjectionInfo(Plan * node, CommonState * commonstate);
|
|
|
|
extern void ExecFreeProjectionInfo(CommonState * commonstate);
|
1997-09-07 07:04:48 +02:00
|
|
|
extern TupleDesc ExecGetScanType(CommonScanState * csstate);
|
|
|
|
extern void
|
|
|
|
ExecAssignScanType(CommonScanState * csstate,
|
|
|
|
TupleDesc tupDesc);
|
|
|
|
extern void
|
|
|
|
ExecAssignScanTypeFromOuterPlan(Plan * node,
|
|
|
|
CommonScanState * csstate);
|
1996-07-09 08:22:35 +02:00
|
|
|
extern AttributeTupleForm ExecGetTypeInfo(Relation relDesc);
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
extern void
|
|
|
|
ExecOpenIndices(Oid resultRelationOid,
|
|
|
|
RelationInfo * resultRelationInfo);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void ExecCloseIndices(RelationInfo * resultRelationInfo);
|
1997-09-07 07:04:48 +02:00
|
|
|
extern void
|
|
|
|
ExecInsertIndexTuples(TupleTableSlot * slot, ItemPointer tupleid,
|
|
|
|
EState * estate, bool is_update);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void resetVarAttrLenForCreateTable(TupleDesc tupType);
|
1997-09-07 07:04:48 +02:00
|
|
|
extern void
|
|
|
|
setVarAttrLenForCreateTable(TupleDesc tupType,
|
|
|
|
List * targetList, List * rangeTable);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* the end
|
1996-07-09 08:22:35 +02:00
|
|
|
* ----------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#endif /* EXECUTOR_H */
|