Re: [PATCHES] [COMMITTERS] pgsql: Change FETCH/MOVE to use int8.

2006-09-02 Thread Bruce Momjian
Tom Lane wrote:
 [EMAIL PROTECTED] (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   [EMAIL PROTECTED]
  EnterpriseDBhttp://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 -	1.108
--- src/backend/tcop/pquery.c	3 Sep 2006 01:13:20 -
***
*** 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 -	1.327
--- src/include/nodes/parsenodes.h	3 Sep 2006 01:13:22 -
***
*** 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
  {

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] [COMMITTERS] pgsql: Change FETCH/MOVE to use int8.

2006-09-02 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes:
 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.

There is *no* credible use case for this (hint: MOVE FORWARD/BACKWARD
ALL does not need this to work for 2G tables).  It is not worth the
extra computational cycles that it imposes on every machine whether they
use the feature or not, and it is certainly not worth the developer time
we're expending to fix this poorly written patch.  Please revert it.

regards, tom lane

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] [PATCHES] [COMMITTERS] pgsql: Change FETCH/MOVE to use int8.

2006-09-02 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes:
 Tom Lane wrote:
 There is *no* credible use case for this (hint: MOVE FORWARD/BACKWARD
 ALL does not need this to work for 2G tables).

 Already done because of bad coding.  You want the TODO item removed too?

As I said, I see no use case for it.  Maybe if Moore's Law holds up for
another five or ten years, it'll look like a useful feature then ...

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings