postgresql/src/include
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
..
access Update typedefs.list to match what the buildfarm currently reports. 2025-12-14 17:03:53 -05:00
archive Update copyright for 2025 2025-01-01 11:21:55 -05:00
backup Add backup_type column to pg_stat_progress_basebackup. 2025-08-05 10:50:45 -07:00
bootstrap Allow redeclaration of typedef yyscan_t 2025-09-12 08:16:00 +02:00
catalog Implement ALTER TABLE ... MERGE PARTITIONS ... command 2025-12-14 13:29:17 +02:00
commands Add started_by column to pg_stat_progress_analyze view. 2025-12-09 11:23:45 -08:00
common Add pg_add_size_overflow() and friends 2025-11-24 09:59:38 -08:00
datatype Avoid using timezone Asia/Manila in regression tests. 2025-01-20 15:47:53 -05:00
executor Update typedefs.list to match what the buildfarm currently reports. 2025-12-14 17:03:53 -05:00
fe_utils Add ParallelSlotSetIdle(). 2025-12-09 13:34:22 -06:00
foreign Improve ExplainState type handling in header files 2025-09-15 11:04:10 +02:00
jit jit: Fix type used for Datum values in LLVM IR. 2025-09-17 13:38:35 +12:00
lib Use palloc_object() and palloc_array() in more areas of the tree 2025-12-09 14:53:17 +09:00
libpq Fix some comments. 2025-12-11 15:13:04 -06:00
mb Remove incorrect declarations in pg_wchar.h. 2025-12-15 10:38:55 -08:00
nodes Update typedefs.list to match what the buildfarm currently reports. 2025-12-14 17:03:53 -05:00
optimizer Add parallelism support for TID Range Scans 2025-11-27 14:05:04 +13:00
parser Implement ALTER TABLE ... SPLIT PARTITION ... command 2025-12-14 13:29:38 +02:00
partitioning Implement ALTER TABLE ... SPLIT PARTITION ... command 2025-12-14 13:29:38 +02:00
pch meson: Increase minimum version to 0.57.2 2025-07-02 11:14:53 +02:00
port Make "pgoff_t" be a typedef not a #define. 2025-12-14 16:53:34 -05:00
portability Update copyright for 2025 2025-01-01 11:21:55 -05:00
postmaster Add log_autoanalyze_min_duration 2025-10-15 14:31:12 +02:00
regex Make <assert.h> consistently available in frontend and backend 2025-12-11 09:56:57 +01:00
replication Add slotsync_skip_reason column to pg_replication_slots view. 2025-11-28 05:21:35 +00:00
rewrite Update various forward declarations to use typedef 2025-09-15 11:04:10 +02:00
snowball Update to latest Snowball sources. 2025-02-18 21:13:54 -05:00
statistics Rework output format of pg_dependencies 2025-11-17 10:44:26 +09:00
storage Switch buffile.c/h to use pgoff_t instead of off_t 2025-12-23 07:41:34 +09:00
tcop Implement WAIT FOR command 2025-11-05 11:44:13 +02:00
tsearch Update copyright for 2025 2025-01-01 11:21:55 -05:00
utils Use proper type for RestoreTransactionSnapshot's PGPROC arg 2025-12-19 13:40:02 +02:00
.gitignore Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
c.h Refactor static_assert() support. 2025-12-15 11:54:23 +01:00
fmgr.h Remove no longer needed casts to Pointer 2025-12-04 19:40:08 +01:00
funcapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
getopt_long.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
Makefile Clean up newly added guc_tables.inc.c 2025-09-04 17:25:43 +02:00
meson.build meson: add and use stamp files for generated headers 2025-08-11 15:18:23 -04:00
miscadmin.h Avoid mixing void and integer in a conditional expression. 2025-11-02 12:30:44 -05:00
pg_config.h.in Refactor static_assert() support. 2025-12-15 11:54:23 +01:00
pg_config_manual.h Move SLRU_PAGES_PER_SEGMENT to pg_config_manual.h 2025-11-10 16:11:41 +02:00
pg_getopt.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pg_trace.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pgstat.h Change pgstat_report_vacuum() to use Relation 2025-12-17 11:26:17 +09:00
pgtar.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgtime.h Seek zone abbreviations in the IANA data before timezone_abbreviations. 2025-01-16 14:11:19 -05:00
port.h Make "pgoff_t" be a typedef not a #define. 2025-12-14 16:53:34 -05:00
postgres.h Grab the low-hanging fruit from forcing USE_FLOAT8_BYVAL to true. 2025-08-13 17:18:22 -04:00
postgres_ext.h Move pg_int64 back to postgres_ext.h 2025-09-16 10:48:56 +02:00
postgres_fe.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
varatt.h Convert varatt.h access macros to static inline functions. 2025-08-05 17:01:25 +02:00
windowapi.h Add IGNORE NULLS/RESPECT NULLS option to Window functions. 2025-10-03 09:47:36 +09:00