aboutsummaryrefslogtreecommitdiff
path: root/src/include/commands
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-03-10 03:53:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-03-10 03:53:52 +0000
commitaa83bc04e089e13f2746ba55720e5993268c46f5 (patch)
tree1b5c0082e22385789d3581792af4e1a823f835ba /src/include/commands
parentb9e8ffcd5d1a3d45b2f697ea944931f56367c86b (diff)
downloadpostgresql-aa83bc04e089e13f2746ba55720e5993268c46f5.tar.gz
postgresql-aa83bc04e089e13f2746ba55720e5993268c46f5.zip
Restructure parsetree representation of DECLARE CURSOR: now it's a
utility statement (DeclareCursorStmt) with a SELECT query dangling from it, rather than a SELECT query with a few unusual fields in it. Add code to determine whether a planned query can safely be run backwards. If DECLARE CURSOR specifies SCROLL, ensure that the plan can be run backwards by adding a Materialize plan node if it can't. Without SCROLL, you get an error if you try to fetch backwards from a cursor that can't handle it. (There is still some discussion about what the exact behavior should be, but this is necessary infrastructure in any case.) Along the way, make EXPLAIN DECLARE CURSOR work.
Diffstat (limited to 'src/include/commands')
-rw-r--r--src/include/commands/portalcmds.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/include/commands/portalcmds.h b/src/include/commands/portalcmds.h
index d143423f6a3..3f2a4221add 100644
--- a/src/include/commands/portalcmds.h
+++ b/src/include/commands/portalcmds.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: portalcmds.h,v 1.4 2002/12/30 15:31:50 momjian Exp $
+ * $Id: portalcmds.h,v 1.5 2003/03/10 03:53:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -16,23 +16,16 @@
#include "utils/portal.h"
-/*
- * PerformPortalFetch
- * Performs the POSTQUEL function FETCH. Fetches count
- * tuples in portal with name in the forward direction iff goForward.
- *
- * Exceptions:
- * BadArg if forward invalid.
- * "ERROR" if portal not found.
- */
+
+extern void PerformCursorOpen(DeclareCursorStmt *stmt, CommandDest dest);
+
extern void PerformPortalFetch(char *name, bool forward, long count,
CommandDest dest, char *completionTag);
-/*
- * PerformPortalClose
- * Performs the POSTQUEL function CLOSE.
- */
-extern void PerformPortalClose(char *name, CommandDest dest);
+extern long DoPortalFetch(Portal portal, bool forward, long count,
+ CommandDest dest);
+
+extern void PerformPortalClose(char *name);
extern void PortalCleanup(Portal portal);