Re: [HACKERS] tables >2GB

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: tih(at)Hamartun(dot)Priv(dot)NO (Tom Ivar Helbekkmo)
Cc: darrenk(at)insightdist(dot)com, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] tables >2GB
Date: 1998-03-20 17:29:18
Message-ID: 199803201729.MAA08356@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> * Bruce Momjian
> |
> | Well, BSD/OS goes over 2gig, but the postgreSQL code uses lseek, which
> | returns long, so even though I can handle larger files, the lseek()
> | can't because long is 32-bits.
>
> Are you sure? In NetBSD, lseek() is declared to return an off_t,
> which again is defined to be a 64bit quantity. I would assume that
> BSD/OS did it the same way -- in fact, I'd be surprised if not.

Oops, you are right:

typedef quad_t off_t;

I thought they added fgetpos() only for 64-bit quantities, and did not
change the return value of lseek. However:

sys/types.h:76: typedef quad_t off_t; /* file offset*/

so you are right, but our code:

fd.c:110: long seekPos;
fd.c:263: fileP->seekPos = (long) lseek(fileP->fd, 0L, SEEK_CUR);

so it still will not work because the code is not defining seekPos as
off_t. We need to get this code cleaned up/fixed.

How could they make such a mistake and assume it is a long, unless this
thing gets passed around in the backend, and they don't want to
reference off_t all over the place? That code needs cleanup.

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Maurice Gittens 1998-03-20 18:30:55 Re: [HACKERS] Re: Buffer overruns with the Electric Fence debugging library (Solved?)
Previous Message Bruce Momjian 1998-03-20 17:24:05 Re: [HACKERS] psql nested queries with 2000+ records