postgresql/contrib
Tom Lane 44cac93464 Avoid using potentially-under-aligned page buffers.
There's a project policy against using plain "char buf[BLCKSZ]" local
or static variables as page buffers; preferred style is to palloc or
malloc each buffer to ensure it is MAXALIGN'd.  However, that policy's
been ignored in an increasing number of places.  We've apparently got
away with it so far, probably because (a) relatively few people use
platforms on which misalignment causes core dumps and/or (b) the
variables chance to be sufficiently aligned anyway.  But this is not
something to rely on.  Moreover, even if we don't get a core dump,
we might be paying a lot of cycles for misaligned accesses.

To fix, invent new union types PGAlignedBlock and PGAlignedXLogBlock
that the compiler must allocate with sufficient alignment, and use
those in place of plain char arrays.

I used these types even for variables where there's no risk of a
misaligned access, since ensuring proper alignment should make
kernel data transfers faster.  I also changed some places where
we had been palloc'ing short-lived buffers, for coding style
uniformity and to save palloc/pfree overhead.

Since this seems to be a live portability hazard (despite the lack
of field reports), back-patch to all supported versions.

Patch by me; thanks to Michael Paquier for review.

Discussion: https://postgr.es/m/1535618100.1286.3.camel@credativ.de
2018-09-01 15:27:17 -04:00
..
adminpack
amcheck
auth_delay
auto_explain Provide a log_level setting for auto_explain 2018-07-31 08:03:57 -04:00
bloom Avoid using potentially-under-aligned page buffers. 2018-09-01 15:27:17 -04:00
btree_gin Provide separate header file for built-in float types 2018-07-29 03:30:48 +02:00
btree_gist Provide separate header file for built-in float types 2018-07-29 03:30:48 +02:00
citext Fix hashjoin costing mistake introduced with inner_unique optimization. 2018-07-14 11:59:12 -04:00
cube Enforce cube dimension limit in all cube construction functions 2018-08-31 20:24:48 +03:00
dblink Deduplicate "invalid input syntax" messages for various types. 2018-07-22 14:58:01 -07:00
dict_int
dict_xsyn
earthdistance Fix earthdistance test suite function name typo. 2018-07-29 12:02:07 -07:00
file_fdw
fuzzystrmatch Replace search.cpan.org with metacpan.org 2018-06-29 22:02:20 +09:00
hstore Provide for contrib and pgxs modules to install include files. 2018-07-31 20:07:39 +01:00
hstore_plperl Fix contrib/hstore_plperl to look through scalar refs. 2018-06-18 15:55:06 -04:00
hstore_plpython
intagg
intarray Fix yet more problems with incorrectly-constructed zero-length arrays. 2018-07-09 14:28:04 -04:00
isn Provide for contrib and pgxs modules to install include files. 2018-07-31 20:07:39 +01:00
jsonb_plperl Rethink how to get float.h in old Windows API for isnan/isinf 2018-07-11 09:11:48 -04:00
jsonb_plpython Fix memory leak in PLySequence_ToJsonbValue() 2018-06-15 15:01:46 +03:00
lo
ltree Provide for contrib and pgxs modules to install include files. 2018-07-31 20:07:39 +01:00
ltree_plpython
oid2name Rework option set of oid2name 2018-08-28 21:33:32 +09:00
pageinspect Make error message of pageinspect more consistent for raw page inputs 2018-07-29 23:50:35 +09:00
passwordcheck
pg_buffercache
pg_freespacemap
pg_prewarm Avoid using potentially-under-aligned page buffers. 2018-09-01 15:27:17 -04:00
pg_standby Avoid using potentially-under-aligned page buffers. 2018-09-01 15:27:17 -04:00
pg_stat_statements Make more consistent some error messages for file-related operations 2018-07-23 09:19:12 +09:00
pg_trgm
pg_visibility
pgcrypto Make capitalization of term "OpenSSL" more consistent 2018-06-29 09:45:44 +09:00
pgrowlocks
pgstattuple
postgres_fdw Disable support for partitionwise joins in problematic cases. 2018-08-31 20:34:06 +09:00
seg Provide for contrib and pgxs modules to install include files. 2018-07-31 20:07:39 +01:00
sepgsql Update sepgsql regression test output for getObjectDescription() changes. 2018-05-24 16:11:25 -04:00
spi Hand code string to integer conversion for performance. 2018-07-22 14:58:23 -07:00
sslinfo
start-scripts
tablefunc
tcn
test_decoding Fix logical replication slot initialization 2018-08-01 17:47:15 -04:00
tsm_system_rows
tsm_system_time Rethink how to get float.h in old Windows API for isnan/isinf 2018-07-11 09:11:48 -04:00
unaccent Add Greek characters to unaccent.rules. 2018-09-02 07:12:24 +12:00
uuid-ossp
vacuumlo Rework option set of vacuumlo 2018-08-28 21:42:45 +09:00
xml2
contrib-global.mk
Makefile
README

The PostgreSQL contrib tree
---------------------------

This subtree contains porting tools, analysis utilities, and plug-in
features that are not part of the core PostgreSQL system, mainly
because they address a limited audience or are too experimental to be
part of the main source tree.  This does not preclude their
usefulness.

User documentation for each module appears in the main SGML
documentation.

When building from the source distribution, these modules are not
built automatically, unless you build the "world" target.  You can
also build and install them all by running "make all" and "make
install" in this directory; or to build and install just one selected
module, do the same in that module's subdirectory.

Some directories supply new user-defined functions, operators, or
types.  To make use of one of these modules, after you have installed
the code you need to register the new SQL objects in the database
system by executing a CREATE EXTENSION command.  In a fresh database,
you can simply do

    CREATE EXTENSION module_name;

See the PostgreSQL documentation for more information about this
procedure.