Attesting to the demand for Postgres support on AIX, associated with the use of SAS, I am aware of ~200 Customers running Postgres on AIX on some 600 unique deployments.
SAS is engaged with IBM regarding Postgres on AX and is a strong advocate to have support for this operating system restored.
-------------------------------------------------------------------
Joe Hatcher
SAS Cloud and Platform - Compute Services
▪
Product Manager
Tel: 919-531-0692
▪ Mobile: 919-624-6149
www.sas.com
SAS®
…
THE POWER TO KNOW®
From: Aditya Kamath <[email protected]>
Sent: Wednesday, January 28, 2026 10:20 AM
To: Srirama Kucherlapati <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: RE: AIX support
EXTERNAL
Hi Andres,
I can explain this differently as well.
We know that include_directories property in meson will include the source and the build directory in the command. Ex: If we give “src/include” then “-Isrc/include” and “-I../src/include” are added.
>> + # This flag is required to make sure the user spefic float.h is
>> + # picked instead of the system float.h header file, which doesnot
>> + # have definition like float8, etc
>> + cflags += '-D_H_FLOAT’
>I don't understand this one - how does defining _H_FLOAT lead to a >different
>header being picked?
Below is the error message we get in AIX if we do not use
'-D_H_FLOAT’
FAILED: src/backend/utils/activity/wait_event_names.a.p/wait_event_funcs.c.o
gcc -Isrc/backend/utils/activity/wait_event_names.a.p -Isrc/include/utils -I../src/include/utils -Isrc/include -I../src/include -I/opt/freeware/include -I/opt/freeware/include/libxml2 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2
-g -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wmissing-prototypes -Wpointer-arith -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -Wdeclaration-after-statement
-Wno-format-truncation -Wno-stringop-truncation -maix64 -fPIC -pthread -DBUILDING_DLL1233 -MD -MQ
./src/include/utils/float.h:28:19: error: expected ';' before 'int'
28 | extern PGDLLIMPORT int extra_float_digits;
There is a clear missing of float.h definitions, the reason being float.h got included before "src/include/c.h”.
Kindly observe the command
"-I../src/include/utils” flag came in the front.
Now in c.h when stdio.h is called in AIX at line 65, then AIX system limits.h is called and then within that AIX system float.h is called.
But here is the catch. It won’t pick the AIX system float.h. It will pick the Postgres "src/include/utilsfloat.h”.
The reason being the compiler is designed to pick what comes first in -I flag. One proof of that is here.
https://gcc.gnu.org/onlinedocs/cpp/Wrapper-Headers.html
I am assuming all systems behave like this.
This is the root cause of the problem. That "-I../src/include/utils” which meson adds.
So now "src/include/utils/float.h”.is picked up first even
before "src/include/c.h”.
That is why we saw the error. When we define “_H_FLOAT” we essentially force the system header to be ignored in the system limits.h where it is called and then the Postgres "src/include/utils/float.h” takes over.
Hope this explains Andres.
There are multiple things we can do here.
One being define “_H_FLOAT”
The other being use #include_next float.h under ifdef _AIX
guard
The third we are experimenting is to have implicit_include_directories: false as per document here
https://mesonbuild.com/Include-directories.html, but that might difficult since recursive include directories exists in Postgres.
Kindly let us know if this explanation helps and what you think. Also
If there is a preferred or cleaner way you know let us know.
Have a nice day ahead.
Thanks and regards,
Aditya.