1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +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

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.52 2003/03/10 03:53:51 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.53 2003/03/11 19:40:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -167,10 +167,12 @@ PortalSetQuery(Portal portal,
AssertArg(PortalIsValid(portal));
portal->queryDesc = queryDesc;
portal->backwardOK = ExecSupportsBackwardScan(queryDesc->plantree);
portal->atStart = true; /* Allow fetch forward only, to start */
portal->atEnd = false;
portal->cleanup = cleanup;
portal->backwardOK = ExecSupportsBackwardScan(queryDesc->plantree);
portal->atStart = true;
portal->atEnd = false; /* allow fetches */
portal->portalPos = 0;
portal->posOverflow = false;
}
/*
@@ -211,10 +213,12 @@ CreatePortal(const char *name)
/* initialize portal query */
portal->queryDesc = NULL;
portal->backwardOK = false;
portal->atStart = true; /* disallow fetches until query is set */
portal->atEnd = true;
portal->cleanup = NULL;
portal->backwardOK = false;
portal->atStart = true;
portal->atEnd = true; /* disallow fetches until query is set */
portal->portalPos = 0;
portal->posOverflow = false;
/* put portal in table */
PortalHashTableInsert(portal);