postgresql/src
Michael Paquier e5f3839af6 Switch buffile.c/h to use pgoff_t instead of off_t
off_t was previously used for offsets, which is 4 bytes on Windows,
hence limiting the backend code to a hard limit for files longer than
2GB.  This leads to some simplification in these files, removing some
casts based on long, also 4 bytes on Windows.

This commit removes one comment introduced in db3c4c3a2d, not relevant
anymore as pgoff_t is a safe 8-byte alternative on Windows.

This change is surprisingly not invasive, as the callers of
BufFileTell(), BufFileSeek() and BufFileTruncateFileSet() (worker.c,
tuplestore.c, etc.) track offsets in local structures that just to
switch from off_t to pgoff_t for the most part.

The file is still relying on a maximum file size of
MAX_PHYSICAL_FILESIZE (1GB).  This change allows the code to make this
maximum potentially larger in the future, or larger on a per-demand
basis.

Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/aUStrqoOCDRFAq1M@paquier.xyz
2025-12-23 07:41:34 +09:00
..
backend Switch buffile.c/h to use pgoff_t instead of off_t 2025-12-23 07:41:34 +09:00
bin psql: Improve tab completion for COPY option lists. 2025-12-22 14:28:12 -08:00
common Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
fe_utils Add ParallelSlotSetIdle(). 2025-12-09 13:34:22 -06:00
include Switch buffile.c/h to use pgoff_t instead of off_t 2025-12-23 07:41:34 +09:00
interfaces libpq-oauth: use correct c_args in meson.build 2025-12-17 11:46:01 -08:00
makefiles Fix meson warning due to missing declaration of NM 2025-12-10 08:10:28 +09:00
pl Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
port Fix O_CLOEXEC flag handling in Windows port. 2025-12-10 09:01:35 +13:00
template Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
test Add missing .gitignore for src/test/modules/test_cloexec. 2025-12-22 14:06:54 -05:00
timezone Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
tools Separate out bytea sort support from varlena.c 2025-12-16 15:19:16 +07:00
tutorial Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in libpq: Refactor logic checking for exit() in shared library builds 2025-12-09 10:39:08 +09:00
Makefile.shlib Use exported symbols list on macOS for loadable modules as well 2025-06-10 07:04:43 +02:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00