postgresql/src/include
Tom Lane 6aebedc384 Grab the low-hanging fruit from forcing sizeof(Datum) to 8.
Remove conditionally-compiled code for smaller Datum widths,
and simplify comments that describe cases no longer of interest.

I also fixed up a few more places that were not using
DatumGetIntXX where they should, and made some cosmetic
adjustments such as using sizeof(int64) not sizeof(Datum)
in places where that fit better with the surrounding code.

One thing I remembered while preparing this part is that SP-GiST
stores pass-by-value prefix keys as Datums, so that the on-disk
representation depends on sizeof(Datum).  That's even more
unfortunate than the existing commentary makes it out to be,
because now there is a hazard that the change of sizeof(Datum)
will break SP-GiST indexes on 32-bit machines.  It appears that
there are no existing SP-GiST opclasses that are actually
affected; and if there are some that I didn't find, the number
of installations that are using them on 32-bit machines is
doubtless tiny.  So I'm proceeding on the assumption that we
can get away with this, but it's something to worry about.

(gininsert.c looks like it has a similar problem, but it's okay
because the "tuples" it's constructing are just transient data
within the tuplesort step.  That's pretty poorly documented
though, so I added some comments.)

Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/1749799.1752797397@sss.pgh.pa.us
2025-08-13 17:18:22 -04:00
..
access Grab the low-hanging fruit from forcing sizeof(Datum) to 8. 2025-08-13 17:18:22 -04: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 pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
catalog Make type Datum be 8 bytes wide everywhere. 2025-08-13 17:18:22 -04:00
commands Add backup_type column to pg_stat_progress_basebackup. 2025-08-05 10:50:45 -07:00
common Extend int128.h to support more numeric code. 2025-08-07 15:49:24 +01:00
datatype Avoid using timezone Asia/Manila in regression tests. 2025-01-20 15:47:53 -05:00
executor Fix security checks in selectivity estimation functions. 2025-08-11 09:03:11 +01:00
fe_utils Remove inappropriate inclusions of c.h and postgres_fe.h. 2025-04-27 16:58:57 -04:00
foreign Update copyright for 2025 2025-01-01 11:21:55 -05:00
jit Don't use double-quotes in #include's of system headers, redux. 2025-04-27 13:23:19 -04:00
lib Use PRI?64 instead of "ll?" in format strings (continued). 2025-03-29 10:43:57 +01:00
libpq Expand usage of macros for protocol characters. 2025-08-06 13:37:00 -05:00
mb With GB18030, prevent SIGSEGV from reading past end of allocation. 2025-05-05 04:52:04 -07:00
nodes Make type Datum be 8 bytes wide everywhere. 2025-08-13 17:18:22 -04:00
optimizer Disallow collecting transition tuples from child foreign tables. 2025-08-08 10:50:00 +09:00
parser Revert support for improved tracking of nested queries 2025-06-12 10:08:55 +09:00
partitioning Fix incorrect #endif comment 2025-03-10 13:36:04 +13:00
pch meson: Increase minimum version to 0.57.2 2025-07-02 11:14:53 +02:00
port Grab the low-hanging fruit from forcing sizeof(Datum) to 8. 2025-08-13 17:18:22 -04:00
portability Update copyright for 2025 2025-01-01 11:21:55 -05:00
postmaster Add option list to CHECKPOINT command. 2025-07-11 11:51:25 -05:00
regex Update copyright for 2025 2025-01-01 11:21:55 -05:00
replication Detect and report update_deleted conflicts. 2025-08-04 04:02:47 +00:00
rewrite Refactor ChangeVarNodesExtended() using the custom callback 2025-05-07 11:10:16 +03:00
snowball Update to latest Snowball sources. 2025-02-18 21:13:54 -05:00
statistics Stats: use schemaname/relname instead of regclass. 2025-03-25 11:16:06 -07:00
storage Cross-check lists of built-in LWLock tranches. 2025-07-23 12:06:20 -05:00
tcop Sync typedefs.list with the buildfarm. 2025-06-15 13:04:24 -04:00
tsearch Update copyright for 2025 2025-01-01 11:21:55 -05:00
utils Grab the low-hanging fruit from forcing sizeof(Datum) to 8. 2025-08-13 17:18:22 -04:00
.gitignore Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
c.h Remove INT64_HEX_FORMAT and UINT64_HEX_FORMAT 2025-08-06 11:08:10 +02:00
fmgr.h Avoid mixing designated and non-designated field initializers. 2025-03-27 11:06:30 -04: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 Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
meson.build meson: add and use stamp files for generated headers 2025-08-11 15:18:23 -04:00
miscadmin.h Revert function to get memory context stats for processes 2025-05-23 15:44:54 +02:00
pg_config.h.in aio: Combine io_uring memory mappings, if supported 2025-07-07 22:57:07 -04:00
pg_config_manual.h Make type Datum be 8 bytes wide everywhere. 2025-08-13 17:18:22 -04: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 Integrate FullTransactionIds deeper into two-phase code 2025-07-07 12:50:40 +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 Add timingsafe_bcmp(), for constant-time memory comparison 2025-04-02 15:32:40 +03:00
postgres.h Make type Datum be 8 bytes wide everywhere. 2025-08-13 17:18:22 -04:00
postgres_ext.h libpq: Deprecate pg_int64. 2025-03-25 21:40:00 +13: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 Update copyright for 2025 2025-01-01 11:21:55 -05:00