diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/executor/execdesc.h | 6 | ||||
-rw-r--r-- | src/include/executor/executor.h | 5 | ||||
-rw-r--r-- | src/include/executor/spi.h | 18 | ||||
-rw-r--r-- | src/include/tcop/pquery.h | 11 | ||||
-rw-r--r-- | src/include/tcop/utility.h | 6 | ||||
-rw-r--r-- | src/include/utils/tqual.h | 17 |
6 files changed, 38 insertions, 25 deletions
diff --git a/src/include/executor/execdesc.h b/src/include/executor/execdesc.h index 131fa727098..c22266a4c41 100644 --- a/src/include/executor/execdesc.h +++ b/src/include/executor/execdesc.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/execdesc.h,v 1.28 2004/08/29 04:13:06 momjian Exp $ + * $PostgreSQL: pgsql/src/include/executor/execdesc.h,v 1.29 2004/09/13 20:07:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -33,6 +33,8 @@ typedef struct QueryDesc CmdType operation; /* CMD_SELECT, CMD_UPDATE, etc. */ Query *parsetree; /* rewritten parsetree */ Plan *plantree; /* planner's output */ + Snapshot snapshot; /* snapshot to use for query */ + Snapshot crosscheck_snapshot; /* crosscheck for RI update/delete */ DestReceiver *dest; /* the destination for tuple output */ ParamListInfo params; /* param values being passed in */ bool doInstrument; /* TRUE requests runtime instrumentation */ @@ -45,6 +47,8 @@ typedef struct QueryDesc /* in pquery.c */ extern QueryDesc *CreateQueryDesc(Query *parsetree, Plan *plantree, + Snapshot snapshot, + Snapshot crosscheck_snapshot, DestReceiver *dest, ParamListInfo params, bool doInstrument); diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index 81b53d272c5..7f894f26d8b 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.112 2004/08/29 05:06:56 momjian Exp $ + * $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.113 2004/09/13 20:07:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -95,8 +95,7 @@ extern HeapTuple ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot); /* * prototypes from functions in execMain.c */ -extern void ExecutorStart(QueryDesc *queryDesc, bool useCurrentSnapshot, - bool explainOnly); +extern void ExecutorStart(QueryDesc *queryDesc, bool explainOnly); extern TupleTableSlot *ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, long count); extern void ExecutorEnd(QueryDesc *queryDesc); diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h index ef10789c614..d58f66ad314 100644 --- a/src/include/executor/spi.h +++ b/src/include/executor/spi.h @@ -2,7 +2,7 @@ * * spi.h * - * $PostgreSQL: pgsql/src/include/executor/spi.h,v 1.47 2004/08/29 05:06:56 momjian Exp $ + * $PostgreSQL: pgsql/src/include/executor/spi.h,v 1.48 2004/09/13 20:07:53 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -81,11 +81,17 @@ extern int SPI_connect(void); extern int SPI_finish(void); extern void SPI_push(void); extern void SPI_pop(void); +extern int SPI_execute(const char *src, bool read_only, int tcount); +extern int SPI_execute_plan(void *plan, Datum *Values, const char *Nulls, + bool read_only, int tcount); extern int SPI_exec(const char *src, int tcount); -extern int SPI_execp(void *plan, Datum *values, const char *Nulls, - int tcount); -extern int SPI_execp_current(void *plan, Datum *values, const char *Nulls, - bool useCurrentSnapshot, int tcount); +extern int SPI_execp(void *plan, Datum *Values, const char *Nulls, + int tcount); +extern int SPI_execute_snapshot(void *plan, + Datum *Values, const char *Nulls, + Snapshot snapshot, + Snapshot crosscheck_snapshot, + bool read_only, int tcount); extern void *SPI_prepare(const char *src, int nargs, Oid *argtypes); extern void *SPI_saveplan(void *plan); extern int SPI_freeplan(void *plan); @@ -113,7 +119,7 @@ extern void SPI_freetuple(HeapTuple pointer); extern void SPI_freetuptable(SPITupleTable *tuptable); extern Portal SPI_cursor_open(const char *name, void *plan, - Datum *Values, const char *Nulls); + Datum *Values, const char *Nulls, bool read_only); extern Portal SPI_cursor_find(const char *name); extern void SPI_cursor_fetch(Portal portal, bool forward, int count); extern void SPI_cursor_move(Portal portal, bool forward, int count); diff --git a/src/include/tcop/pquery.h b/src/include/tcop/pquery.h index e2146a4d640..ced83499b30 100644 --- a/src/include/tcop/pquery.h +++ b/src/include/tcop/pquery.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/tcop/pquery.h,v 1.32 2004/08/29 04:13:10 momjian Exp $ + * $PostgreSQL: pgsql/src/include/tcop/pquery.h,v 1.33 2004/09/13 20:08:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -20,15 +20,10 @@ extern DLLIMPORT Portal ActivePortal; -extern void ProcessQuery(Query *parsetree, - Plan *plan, - ParamListInfo params, - DestReceiver *dest, - char *completionTag); - extern PortalStrategy ChoosePortalStrategy(List *parseTrees); -extern void PortalStart(Portal portal, ParamListInfo params); +extern void PortalStart(Portal portal, ParamListInfo params, + Snapshot snapshot); extern void PortalSetResultFormat(Portal portal, int nFormats, int16 *formats); diff --git a/src/include/tcop/utility.h b/src/include/tcop/utility.h index 68846898450..ce1ed4dcf7c 100644 --- a/src/include/tcop/utility.h +++ b/src/include/tcop/utility.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/tcop/utility.h,v 1.24 2004/08/29 05:06:58 momjian Exp $ + * $PostgreSQL: pgsql/src/include/tcop/utility.h,v 1.25 2004/09/13 20:08:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -26,6 +26,10 @@ extern TupleDesc UtilityTupleDescriptor(Node *parsetree); extern const char *CreateCommandTag(Node *parsetree); +extern const char *CreateQueryTag(Query *parsetree); + +extern bool QueryIsReadOnly(Query *parsetree); + extern void CheckRelationOwnership(RangeVar *rel, bool noCatalogs); #endif /* UTILITY_H */ diff --git a/src/include/utils/tqual.h b/src/include/utils/tqual.h index 627bcaf75a1..1e7bb617330 100644 --- a/src/include/utils/tqual.h +++ b/src/include/utils/tqual.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/tqual.h,v 1.51 2004/09/11 18:28:34 tgl Exp $ + * $PostgreSQL: pgsql/src/include/utils/tqual.h,v 1.52 2004/09/13 20:08:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -54,8 +54,10 @@ typedef SnapshotData *Snapshot; #define SnapshotToast ((Snapshot) 0x4) extern DLLIMPORT Snapshot SnapshotDirty; -extern DLLIMPORT Snapshot QuerySnapshot; + extern DLLIMPORT Snapshot SerializableSnapshot; +extern DLLIMPORT Snapshot LatestSnapshot; +extern DLLIMPORT Snapshot ActiveSnapshot; extern TransactionId RecentXmin; extern TransactionId RecentGlobalXmin; @@ -121,10 +123,13 @@ extern int HeapTupleSatisfiesUpdate(HeapTupleHeader tuple, extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId OldestXmin); -extern Snapshot GetSnapshotData(Snapshot snapshot, bool serializable); -extern void SetQuerySnapshot(void); -extern Snapshot CopyQuerySnapshot(void); -extern Snapshot CopyCurrentSnapshot(void); +extern Snapshot GetTransactionSnapshot(void); +extern Snapshot GetLatestSnapshot(void); +extern Snapshot CopySnapshot(Snapshot snapshot); +extern void FreeSnapshot(Snapshot snapshot); extern void FreeXactSnapshot(void); +/* in sinval.c; declared here to avoid including tqual.h in sinval.h: */ +extern Snapshot GetSnapshotData(Snapshot snapshot, bool serializable); + #endif /* TQUAL_H */ |