1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +03:00

Implement SQL92-compatible FIRST, LAST, ABSOLUTE n, RELATIVE n options

for FETCH and MOVE.
This commit is contained in:
Tom Lane
2003-03-11 19:40:24 +00:00
parent e4704001ea
commit 6261c75014
13 changed files with 669 additions and 387 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: parsenodes.h,v 1.232 2003/03/10 03:53:51 tgl Exp $
* $Id: parsenodes.h,v 1.233 2003/03/11 19:40:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1228,16 +1228,21 @@ typedef struct ClosePortalStmt
*/
typedef enum FetchDirection
{
/* for these, howMany is how many rows to fetch; FETCH_ALL means ALL */
FETCH_FORWARD,
FETCH_BACKWARD
/* ABSOLUTE someday? */
FETCH_BACKWARD,
/* for these, howMany indicates a position; only one row is fetched */
FETCH_ABSOLUTE,
FETCH_RELATIVE
} FetchDirection;
#define FETCH_ALL LONG_MAX
typedef struct FetchStmt
{
NodeTag type;
FetchDirection direction; /* see above */
long howMany; /* number of rows */
long howMany; /* number of rows, or position argument */
char *portalname; /* name of portal (cursor) */
bool ismove; /* TRUE if MOVE */
} FetchStmt;