Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIybu-000EMT-Gz for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Dec 2024 23:16:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tIybr-0037Aj-8O for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Dec 2024 23:16:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIybq-0037Ab-Um for pgsql-hackers@lists.postgresql.org; Wed, 04 Dec 2024 23:16:44 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIybp-0015bg-5B for pgsql-hackers@lists.postgresql.org; Wed, 04 Dec 2024 23:16:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4B4NGVVL2412343; Wed, 4 Dec 2024 18:16:31 -0500 From: Tom Lane To: Thomas Munro cc: Tomas Vondra , Peter Eisentraut , Heikki Linnakangas , Japin Li , Andres Freund , PostgreSQL Hackers Subject: Re: Cannot find a working 64-bit integer type on Illumos In-reply-to: References: <20240322165305.6zrtxcmzdrywvmsu@awork3.anarazel.de> <944094.1711128356@sss.pgh.pa.us> <1229869.1711160593@sss.pgh.pa.us> <7cf1dcb7-306f-4418-bf25-bdc75130db10@eisentraut.org> <0e2cc7af-f0c0-418c-b640-e5eb03eaa6e6@eisentraut.org> <50a4c05e-c43e-4e7e-95d2-4b16493073ed@eisentraut.org> <238! 5947.1733341279@sss.pgh.pa.us> <2397643.1733347237@sss.pgh.pa.us> <2401111.1733349005@sss.pgh.pa.us> <2402151.1733349346@sss.pgh.pa.us> Comments: In-reply-to Thomas Munro message dated "Thu, 05 Dec 2024 11:45:50 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2412341.1733354191.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 04 Dec 2024 18:16:31 -0500 Message-ID: <2412342.1733354191@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thomas Munro writes: > On Thu, Dec 5, 2024 at 10:58=E2=80=AFAM Thomas Munro wrote: >> On Thu, Dec 5, 2024 at 10:55=E2=80=AFAM Tom Lane wr= ote: >>> Could another way be to read pg_config.h before postgres_ext.h? >>> I think the current order was intentional, but maybe the >>> disadvantages outweigh the advantages now. > Seems good to me. Also there were another couple of contortions due > to the older ordering, which we could improve I think? In c.h, I'd put in a very explicit comment in front of pg_config.h. Also, I don't like making it look like postgres_ext.h is of the same ilk as the config headers, since it isn't. So maybe like /* * These headers must be included before any system headers, because * on some platforms they affect the behavior of the system headers * (for example, by defining _FILE_OFFSET_BITS). */ #include "pg_config.h" #include "pg_config_manual.h" /* must be after pg_config.h */ #include "pg_config_os.h" /* must be before any system header files = */ /* Pull in fundamental symbols that we also expose to applications */ #include "postgres_ext.h" /* System header files that should be available everywhere in Postgres */ #include ... The comment for pg_config_os.h is redundant this way, maybe we could rewrite it as something more useful? Also, there's probably no reason anymore that postgres_ext.h couldn't be placed after those fundamental system headers, and that might be clearer. (I think perhaps the main reason for the existing ordering was to demonstrate that postgres_ext.h could be included before any system headers, and that's no longer a consideration.) I don't especially care for your proposed changes to postgres_ext.h. That substantially expands the footprint of what gets defined by pulling that in, and some users might not care for that. (For example, because they have ordering assumptions similar to what we're dealing with here.) Now you already snuck the camel's nose under the tent by including stdint.h there, and maybe these additional headers wouldn't do any further damage. But I don't see a strong argument to change long-standing external APIs any more than we absolutely must. regards, tom lane