From: Michael Paquier <michael@paquier.xyz>
To: Chao Li <li.evan.chao@gmail.com>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Cc: Bryan Green <dbryan.green@gmail.com>
Subject: Re: Switch buffile.c/h to use pgoff_t
Date: Fri, 19 Dec 2025 14:22:02 +0900
Message-ID: <aUTg-rH4mOVF9rTo@paquier.xyz> (raw)
In-Reply-To: <85F6E9BB-59E8-4BD5-9FC1-357C3ACD5F87@gmail.com>
References: <aUStrqoOCDRFAq1M@paquier.xyz>
<85F6E9BB-59E8-4BD5-9FC1-357C3ACD5F87@gmail.com>
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
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: michael@paquier.xyz, li.evan.chao@gmail.com, dbryan.green@gmail.com
Subject: Re: Switch buffile.c/h to use pgoff_t
In-Reply-To: <aUTg-rH4mOVF9rTo@paquier.xyz>
References: <aUStrqoOCDRFAq1M@paquier.xyz> <85F6E9BB-59E8-4BD5-9FC1-357C3ACD5F87@gmail.com> <aUTg-rH4mOVF9rTo@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox