Tom Lane wrote:
> momjian@postgresql.org (Bruce Momjian) writes:
> > Log Message:
> > -----------
> > Change FETCH/MOVE to use int8.
>
> This patch has broken half the buildfarm, and I've still not seen a
> rationale why we need to make such a change at all.
Fixed with attached patch. The use case for this was not FETCH, but
MOVE for > 2gig tables.
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
Index: src/backend/tcop/pquery.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/tcop/pquery.c,v
retrieving revision 1.108
diff -c -c -r1.108 pquery.c
*** src/backend/tcop/pquery.c 2 Sep 2006 18:17:17 -0000 1.108
--- src/backend/tcop/pquery.c 3 Sep 2006 01:13:20 -0000
***************
*** 1347,1353 ****
* we are. In any case, we arrange to fetch the target row
* going forwards.
*/
! if (portal->posOverflow || portal->portalPos == LLONG_MAX ||
count - 1 <= portal->portalPos / 2)
{
DoPortalRewind(portal);
--- 1347,1353 ----
* we are. In any case, we arrange to fetch the target row
* going forwards.
*/
! if (portal->posOverflow || portal->portalPos == FETCH_ALL ||
count - 1 <= portal->portalPos / 2)
{
DoPortalRewind(portal);
Index: src/include/nodes/parsenodes.h
===================================================================
RCS file: /cvsroot/pgsql/src/include/nodes/parsenodes.h,v
retrieving revision 1.327
diff -c -c -r1.327 parsenodes.h
*** src/include/nodes/parsenodes.h 2 Sep 2006 18:17:17 -0000 1.327
--- src/include/nodes/parsenodes.h 3 Sep 2006 01:13:22 -0000
***************
*** 14,19 ****
--- 14,21 ----
#ifndef PARSENODES_H
#define PARSENODES_H
+ #include "limits.h"
+
#include "nodes/primnodes.h"
#include "nodes/value.h"
***************
*** 1439,1445 ****
--- 1441,1452 ----
FETCH_RELATIVE
} FetchDirection;
+ #ifdef HAVE_INT64
#define FETCH_ALL LLONG_MAX
+ #else
+ #define FETCH_ALL LONG_MAX
+ #endif
+
typedef struct FetchStmt
{