postgresql/src/include/utils
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
..
.gitignore Generate automatically code and documentation related to wait events 2023-07-05 10:53:11 +09:00
acl.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
aclchk_internal.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
array.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
arrayaccess.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
ascii.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
attoptcache.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
backend_progress.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
backend_status.h Change internal plan ID type from uint64 to int64 2025-05-31 09:40:45 +09:00
builtins.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
bytea.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
cash.h Convert *GetDatum() and DatumGet*() macros to inline functions 2022-09-27 20:50:21 +02:00
catcache.h Silence Valgrind leakage complaints in more-or-less-hackish ways. 2025-08-02 21:59:46 -04:00
combocid.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
conffiles.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
date.h Break out xxx2yyy_opt_overflow APIs for more datetime conversions. 2025-07-03 16:17:08 -04:00
datetime.h Seek zone abbreviations in the IANA data before timezone_abbreviations. 2025-01-16 14:11:19 -05:00
datum.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
dsa.h Add GetNamedDSA() and GetNamedDSHash(). 2025-07-02 11:50:52 -05:00
dynahash.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
elog.h Sync typedefs.list with the buildfarm. 2025-06-15 13:04:24 -04:00
evtcache.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
expandeddatum.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
expandedrecord.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
float.h pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
fmgrtab.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
formatting.h Add SQL function CASEFOLD(). 2025-01-24 14:56:22 -08:00
freepage.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
funccache.h Change SQL-language functions to use the plan cache. 2025-04-02 14:06:02 -04:00
geo_decls.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
guc.h aio: Basic subsystem initialization 2025-03-17 18:51:33 -04:00
guc_hooks.h Fix the handling of two GUCs during upgrade. 2025-07-11 10:46:43 +05:30
guc_tables.h Add vacuum_truncate configuration parameter. 2025-03-20 10:16:50 -05:00
help_config.h pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
hsearch.h Revert "Improve accounting for memory used by shared hash tables" 2025-04-04 04:43:50 +02:00
index_selfuncs.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
inet.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
injection_point.h Add InjectionPointList() to retrieve list of injection points 2025-07-03 08:41:25 +09:00
inval.h Avoid invalidating all RelationSyncCache entries on publication rename. 2025-03-13 09:16:33 +05:30
json.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
jsonb.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
jsonfuncs.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
jsonpath.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
logtape.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
lsyscache.h Relax ordering-related hardcoded btree requirements in planning 2025-04-06 14:43:51 +02:00
memdebug.h Improve our support for Valgrind's leak tracking. 2025-08-02 21:59:46 -04:00
memutils.h Revert function to get memory context stats for processes 2025-05-23 15:44:54 +02:00
memutils_internal.h pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
memutils_memorychunk.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
multirangetypes.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
numeric.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
palloc.h Create infrastructure to reliably prevent leakage of PGresults. 2025-07-25 16:30:00 -04:00
partcache.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_crc.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_locale.h Update ICU C++ API symbols 2025-08-07 17:10:52 +07:00
pg_lsn.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_rusage.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgstat_internal.h Fix performance regression with flush of pending fixed-numbered stats 2025-07-28 08:15:11 +09:00
pgstat_kind.h Lower bounds related to pgstats kinds 2025-07-25 11:17:48 +09:00
pidfile.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
plancache.h Revert "Don't lock partitions pruned by initial pruning" 2025-05-22 17:02:35 +09:00
portal.h Revert "Don't lock partitions pruned by initial pruning" 2025-05-22 17:02:35 +09:00
ps_status.h Speedup and increase usability of set proc title functions 2023-02-20 16:18:27 +13:00
queryenvironment.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
rangetypes.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
regproc.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
rel.h Add support for NOT ENFORCED in foreign key constraints 2025-04-02 13:36:44 +02:00
relcache.h Assert lack of hazardous buffer locks before possible catalog read. 2025-04-17 05:00:30 -07:00
relfilenumbermap.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
relmapper.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
relptr.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
reltrigger.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
resowner.h aio: Basic subsystem initialization 2025-03-17 18:51:33 -04:00
rls.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
ruleutils.h Improve EXPLAIN's display of window functions. 2025-03-11 11:19:54 -04:00
sampling.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
selfuncs.h Fix security checks in selectivity estimation functions. 2025-08-11 09:03:11 +01:00
sharedtuplestore.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
skipsupport.h Sync typedefs.list with the buildfarm. 2025-06-15 13:04:24 -04:00
snapmgr.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
snapshot.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
sortsupport.h Grab the low-hanging fruit from forcing sizeof(Datum) to 8. 2025-08-13 17:18:22 -04:00
spccache.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
syscache.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
timeout.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
timestamp.h Break out xxx2yyy_opt_overflow APIs for more datetime conversions. 2025-07-03 16:17:08 -04:00
tuplesort.h Allow parallel CREATE INDEX for GIN indexes 2025-03-03 16:53:06 +01:00
tuplestore.h Harmonize function parameter names for Postgres 18. 2025-04-12 12:07:36 -04:00
typcache.h Introduce a SQL-callable function array_sort(anyarray). 2025-04-01 18:03:55 -04:00
tzparser.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
usercontext.h Perform logical replication actions as the table owner. 2023-04-04 11:25:23 -04:00
uuid.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
varbit.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
varlena.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
wait_classes.h Remove circular #include's between wait_event.h and wait_event_types.h 2025-04-28 09:08:15 +09:00
wait_event.h Remove circular #include's between wait_event.h and wait_event_types.h 2025-04-28 09:08:15 +09:00
xid8.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
xml.h Update copyright for 2025 2025-01-01 11:21:55 -05:00