Re: Switch buffile.c/h to use pgoff_t - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Switch buffile.c/h to use pgoff_t
Date
Msg-id aUTg-rH4mOVF9rTo@paquier.xyz
Whole thread Raw
In response to Re: Switch buffile.c/h to use pgoff_t  (Chao Li <li.evan.chao@gmail.com>)
List pgsql-hackers
On Fri, Dec 19, 2025 at 11:00:54AM +0800, Chao Li wrote:
> Given MAX_PHYSICAL_FILESIZE is just 1G (2^30), why availbytes has to
> be pgoff_t instead of just int?

The point of such changes would be to lift this barrier at some point,
which is what the other thread I am mentioning upthread is also
pointing at.  It does not change the fact that this code is currently
not portable as written: off_t can be 4 or 8 bytes depending on the
environment, and pgoff_t exists to be a stable alternative.  This
relates as well to the use of long in the tree, all coming down to
WIN32.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Switch buffile.c/h to use pgoff_t
Next
From: Chao Li
Date:
Subject: Re: DOC: fixes multiple errors in alter table doc