diff options
Diffstat (limited to 'src/include/utils/portal.h')
-rw-r--r-- | src/include/utils/portal.h | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/src/include/utils/portal.h b/src/include/utils/portal.h index 7da359cbe73..6c7664f04db 100644 --- a/src/include/utils/portal.h +++ b/src/include/utils/portal.h @@ -9,7 +9,7 @@ * * Scrolling (nonsequential access) and suspension of execution are allowed * only for portals that contain a single SELECT-type query. We do not want - * to let the client suspend an update-type query partway through! Because + * to let the client suspend an update-type query partway through! Because * the query rewriter does not allow arbitrary ON SELECT rewrite rules, * only queries that were originally update-type could produce multiple * parse/plan trees; so the restriction to a single query is not a problem @@ -18,13 +18,13 @@ * For SQL cursors, we support three kinds of scroll behavior: * * (1) Neither NO SCROLL nor SCROLL was specified: to remain backward - * compatible, we allow backward fetches here, unless it would - * impose additional runtime overhead to do so. + * compatible, we allow backward fetches here, unless it would + * impose additional runtime overhead to do so. * * (2) NO SCROLL was specified: don't allow any backward fetches. * * (3) SCROLL was specified: allow all kinds of backward fetches, even - * if we need to take a performance hit to do so. (The planner sticks + * if we need to take a performance hit to do so. (The planner sticks * a Materialize node atop the query plan if needed.) * * Case #1 is converted to #2 or #3 by looking at the query itself and @@ -39,7 +39,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: portal.h,v 1.44 2003/05/08 18:16:37 tgl Exp $ + * $Id: portal.h,v 1.45 2003/08/04 00:43:32 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -58,8 +58,8 @@ * single result from the user's viewpoint. However, the rule rewriter * may expand the single source query to zero or many actual queries.) * - * PORTAL_ONE_SELECT: the portal contains one single SELECT query. We run - * the Executor incrementally as results are demanded. This strategy also + * PORTAL_ONE_SELECT: the portal contains one single SELECT query. We run + * the Executor incrementally as results are demanded. This strategy also * supports holdable cursors (the Executor results can be dumped into a * tuplestore for access after transaction completion). * @@ -77,7 +77,7 @@ typedef enum PortalStrategy PORTAL_ONE_SELECT, PORTAL_UTIL_SELECT, PORTAL_MULTI_QUERY -} PortalStrategy; +} PortalStrategy; /* * Note: typedef Portal is declared in tcop/dest.h as @@ -89,7 +89,7 @@ typedef struct PortalData /* Bookkeeping data */ const char *name; /* portal's name */ MemoryContext heap; /* subsidiary memory for portal */ - void (*cleanup) (Portal portal, bool isError); /* cleanup hook */ + void (*cleanup) (Portal portal, bool isError); /* cleanup hook */ TransactionId createXact; /* the xid of the creating xact */ /* The query or queries the portal will execute */ @@ -97,15 +97,16 @@ typedef struct PortalData const char *commandTag; /* command tag for original query */ List *parseTrees; /* parse tree(s) */ List *planTrees; /* plan tree(s) */ - MemoryContext queryContext; /* where the above trees live */ + MemoryContext queryContext; /* where the above trees live */ + /* * Note: queryContext effectively identifies which prepared statement * the portal depends on, if any. The queryContext is *not* owned by - * the portal and is not to be deleted by portal destruction. (But for - * a cursor it is the same as "heap", and that context is deleted by - * portal destruction.) + * the portal and is not to be deleted by portal destruction. (But + * for a cursor it is the same as "heap", and that context is deleted + * by portal destruction.) */ - ParamListInfo portalParams; /* params to pass to query */ + ParamListInfo portalParams; /* params to pass to query */ /* Features/options */ PortalStrategy strategy; /* see above */ @@ -113,7 +114,7 @@ typedef struct PortalData /* Status data */ bool portalReady; /* PortalStart complete? */ - bool portalUtilReady; /* PortalRunUtility complete? */ + bool portalUtilReady; /* PortalRunUtility complete? */ bool portalActive; /* portal is running (can't delete it) */ bool portalDone; /* portal is finished (don't re-run it) */ @@ -126,21 +127,21 @@ typedef struct PortalData int16 *formats; /* a format code for each column */ /* - * Where we store tuples for a held cursor or a PORTAL_UTIL_SELECT query. - * (A cursor held past the end of its transaction no longer has any - * active executor state.) + * Where we store tuples for a held cursor or a PORTAL_UTIL_SELECT + * query. (A cursor held past the end of its transaction no longer has + * any active executor state.) */ - Tuplestorestate *holdStore; /* store for holdable cursors */ - MemoryContext holdContext; /* memory containing holdStore */ + Tuplestorestate *holdStore; /* store for holdable cursors */ + MemoryContext holdContext; /* memory containing holdStore */ /* * atStart, atEnd and portalPos indicate the current cursor position. - * portalPos is zero before the first row, N after fetching N'th row of - * query. After we run off the end, portalPos = # of rows in query, and - * atEnd is true. If portalPos overflows, set posOverflow (this causes - * us to stop relying on its value for navigation). Note that atStart - * implies portalPos == 0, but not the reverse (portalPos could have - * overflowed). + * portalPos is zero before the first row, N after fetching N'th row + * of query. After we run off the end, portalPos = # of rows in + * query, and atEnd is true. If portalPos overflows, set posOverflow + * (this causes us to stop relying on its value for navigation). Note + * that atStart implies portalPos == 0, but not the reverse (portalPos + * could have overflowed). */ bool atStart; bool atEnd; @@ -172,11 +173,11 @@ extern void PortalDrop(Portal portal, bool isError); extern void DropDependentPortals(MemoryContext queryContext); extern Portal GetPortalByName(const char *name); extern void PortalDefineQuery(Portal portal, - const char *sourceText, - const char *commandTag, - List *parseTrees, - List *planTrees, - MemoryContext queryContext); + const char *sourceText, + const char *commandTag, + List *parseTrees, + List *planTrees, + MemoryContext queryContext); extern void PortalCreateHoldStore(Portal portal); #endif /* PORTAL_H */ |