Base de données relationnelle
Find a file
Tom Lane ecae097252 Cope with AIX's alignment woes by using _Pragma("pack").
Because we assume that int64 and double have the same alignment
requirement, AIX's default behavior that alignof(double) = 4 while
alignof(int64) = 8 is a headache.  There are two issues:

1. We align both int8 and float8 tuple columns per ALIGNOF_DOUBLE,
which is an ancient choice that can't be undone without breaking
pg_upgrade and creating some subtle SQL-level compatibility issues
too.  However, the cost of that is just some marginal inefficiency
in fetching int8 values, which can't be too awful if the platform
architects were willing to pay the same costs for fetching float8s.
So our decision is to leave that alone.  This patch makes our
alignment choices the same as they were pre-v17, namely that
ALIGNOF_DOUBLE and ALIGNOF_INT64_T are whatever the compiler prefers
and then MAXIMUM_ALIGNOF is the larger of the two.  (On all supported
platforms other than AIX, all three values will be the same.)

2.  We need to overlay C structs onto catalog tuples, and int8 fields
in those struct declarations may not be aligned to match this rule.

In the old branches we had some annoying rules about ordering catalog
columns to avoid alignment problems, but nobody wants to resurrect
those.  However, there's a better answer: make the compiler construe
those struct declarations the way we need it to by using the pack(N)
pragma.  This requires no manual effort to maintain going forward;
we only have to insert the pragma into all the catalog *.h files.
(As the catalogs stand at this writing, nothing actually changes
because we've not moved any affected columns since v16; hence no
catversion bump is required.  The point of this is to not have
to worry about the issue going forward.)

We did not have this option when the AIX port was first made.  This
patch depends on the C99 feature _Pragma(), as well as the pack(N)
pragma which dates to somewhere around gcc 4.0, and probably doesn't
exist in xlc at all.  But now that we've agreed to toss xlc support
out the window, there doesn't seem to be a reason not to go this way.

In passing, I got rid of LONGALIGN[_DOWN] along with the configure
probes for ALIGNOF_LONG.  We were not using those anywhere and it
seems highly unlikely that we'd do so in future.  Instead supply
INT64ALIGN[_DOWN], which isn't used either but at least could
have a good reason to be used.

Discussion: https://postgr.es/m/1127261.1769649624@sss.pgh.pa.us
2026-02-23 12:34:54 -05:00
.github Add CODE_OF_CONDUCT.md, CONTRIBUTING.md, and SECURITY.md. 2024-07-02 13:03:58 -05:00
config Revert "Change copyObject() to use typeof_unqual" 2026-02-07 10:08:38 +01:00
contrib Fix additional fallthrough warnings from clang 2026-02-23 07:40:19 +01:00
doc Warn upon successful MD5 password authentication. 2026-02-23 11:22:04 -06:00
src Cope with AIX's alignment woes by using _Pragma("pack"). 2026-02-23 12:34:54 -05:00
.cirrus.star ci: Simplify ci-os-only handling 2025-08-14 12:09:34 -04:00
.cirrus.tasks.yml meson: allow disabling building/installation of static libraries. 2026-02-23 16:45:40 +01:00
.cirrus.yml ci: Per-repo configuration for manually trigger tasks 2025-08-14 11:54:03 -04:00
.dir-locals.el Make Emacs perl-mode indent more like perltidy. 2019-01-13 11:32:31 -08:00
.editorconfig Update .editorconfig and .gitattributes for postgresql.conf.sample. 2025-11-18 10:28:36 -06:00
.git-blame-ignore-revs Add a couple of recent commits to .git-blame-ignore-revs. 2026-01-28 15:56:48 -06:00
.gitattributes Update .editorconfig and .gitattributes for postgresql.conf.sample. 2025-11-18 10:28:36 -06:00
.gitignore Update top-level .gitignore. 2022-12-04 15:23:00 -05:00
.mailmap Add a Git .mailmap file 2024-11-05 13:56:02 +01:00
aclocal.m4 autoconf: Move export_dynamic determination to configure 2022-12-06 18:55:28 -08:00
configure Cope with AIX's alignment woes by using _Pragma("pack"). 2026-02-23 12:34:54 -05:00
configure.ac Cope with AIX's alignment woes by using _Pragma("pack"). 2026-02-23 12:34:54 -05:00
COPYRIGHT Update copyright for 2026 2026-01-01 13:24:10 -05:00
GNUmakefile.in Allow selecting the git revision to be packaged by "make dist". 2024-05-03 11:08:50 -04:00
HISTORY Canonicalize some URLs 2020-02-10 20:47:50 +01:00
Makefile Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Cope with AIX's alignment woes by using _Pragma("pack"). 2026-02-23 12:34:54 -05:00
meson_options.txt Update copyright for 2026 2026-01-01 13:24:10 -05:00
README.md Revise the style of a paragraph in README.md. 2024-03-21 10:16:41 -05:00

PostgreSQL Database Management System

This directory contains the source code distribution of the PostgreSQL database management system.

PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.

Copyright and license information can be found in the file COPYRIGHT.

General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.

The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.