diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-09-13 20:10:13 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-09-13 20:10:13 +0000 |
| commit | b2c4071299e02ed96d48d3c8e776de2fab36f88c (patch) | |
| tree | ff0db14826870f1c3fe46d94ea3a1e1697c658a7 /src/include/tcop | |
| parent | d69528881ab72eac5a9f154f23dbf549789c264d (diff) | |
| download | postgresql-b2c4071299e02ed96d48d3c8e776de2fab36f88c.tar.gz | |
Redesign query-snapshot timing so that volatile functions in READ COMMITTED
mode see a fresh snapshot for each command in the function, rather than
using the latest interactive command's snapshot. Also, suppress fresh
snapshots as well as CommandCounterIncrement inside STABLE and IMMUTABLE
functions, instead using the snapshot taken for the most closely nested
regular query. (This behavior is only sane for read-only functions, so
the patch also enforces that such functions contain only SELECT commands.)
As per my proposal of 6-Sep-2004; I note that I floated essentially the
same proposal on 19-Jun-2002, but that discussion tailed off without any
action. Since 8.0 seems like the right place to be taking possibly
nontrivial backwards compatibility hits, let's get it done now.
Diffstat (limited to 'src/include/tcop')
| -rw-r--r-- | src/include/tcop/pquery.h | 11 | ||||
| -rw-r--r-- | src/include/tcop/utility.h | 6 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/include/tcop/pquery.h b/src/include/tcop/pquery.h index e2146a4d64..ced83499b3 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 6884689845..ce1ed4dcf7 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 */ |
