aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/portal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/utils/portal.h')
-rw-r--r--src/include/utils/portal.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/include/utils/portal.h b/src/include/utils/portal.h
index 21469dd52df..c9ca8547ce2 100644
--- a/src/include/utils/portal.h
+++ b/src/include/utils/portal.h
@@ -9,7 +9,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.38 2003/03/10 03:53:52 tgl Exp $
+ * $Id: portal.h,v 1.39 2003/03/11 19:40:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,10 +27,21 @@ typedef struct PortalData
char *name; /* Portal's name */
MemoryContext heap; /* subsidiary memory */
QueryDesc *queryDesc; /* Info about query associated with portal */
- bool backwardOK; /* is fetch backwards allowed at all? */
- bool atStart; /* T => fetch backwards is not allowed now */
- bool atEnd; /* T => fetch forwards is not allowed now */
void (*cleanup) (Portal); /* Cleanup routine (optional) */
+ bool backwardOK; /* is fetch backwards allowed? */
+ /*
+ * 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).
+ */
+ bool atStart;
+ bool atEnd;
+ bool posOverflow;
+ long portalPos;
} PortalData;
/*