Re: Cannot find a working 64-bit integer type on Illumos
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Thomas Munro <thomas.munro@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Tomas Vondra <tomas@vondra.me>, Heikki Linnakangas <hlinnaka@iki.fi>,
Japin Li <japinli@hotmail.com>, Andres Freund <andres@anarazel.de>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-03-04T17:00:12Z
Lists: pgsql-hackers
On 10.12.24 03:02, Thomas Munro wrote: > On Thu, Dec 5, 2024 at 12:16 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: >> 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. > > Even though we fixed the immediate issue (thanks), this comment stayed > with me. I did that because I didn't want to change any interfaces at > the same time as the <stdint.h> retrofit, but I agree that it feels a > bit odd hidden in there, and doesn't appear to conform to > postgres_ext.h's self-description. Stepping back, and I realise it's > difficult to answer with certainty, I wonder why anyone would ever > want to use postgres_ext.h directly for the definition of pg_int64 > *without* being a user of libpq-fe.h. I can't find any references to > pg_int64 (excluding forks of our code) on github; there are a few > things like proxies and suchlike that include postgres_ext.h for other > things, mostly bogusly (they also include libpq-fe.h, or they say they > want NAMEDATALEN, which isn't there anymore). > > We have just three lo_*64() functions using that type and then > pg_usec_time_t. Seems like a very narrow usage that hasn't spread, > likely only used to receive arguments, and really quite specific to > libpq-fe.h and not one of the "fundamental Postgres declarations". > Maybe we should consider moving #include <stdint.h> into libpq-fe.h? > > And if we included <stdint.h> overtly, rather than covertly in > postgres_ext.h, why would we still want a third name for int64_t? We > could change the three lo_*64() declarations to use the standard type > directly, but keep the historical typedef marked deprecated. I agree with your patch 0001-Deprecate-pg_int64.patch. I don't see a reason to keep the current arrangement around pg_int64.
Commits
-
Move pg_int64 back to postgres_ext.h
- e56a601e0678 19 (unreleased) landed
- 409543da5411 18.0 landed
-
pgbench: Make set_random_seed() 64-bit everywhere.
- 53a2a1564ae4 18.0 landed
-
Use PRI?64 instead of "ll?" in format strings (continued).
- a0ed19e0a9ef 18.0 landed
-
Fix order of -I switches for building pg_regress.o.
- f186f90e55b7 17.5 landed
- cb36f8ec2124 18.0 landed
-
libpq: Deprecate pg_int64.
- 3c86223c9982 18.0 landed
-
Use PRI*64 instead of "ll*" in format strings (minimal trial)
- 15a79c73111f 18.0 landed
-
Fix header inclusion order in c.h.
- 71cb352904c1 18.0 landed
-
Use <stdint.h> and <inttypes.h> for c.h integers.
- 962da900ac8f 18.0 landed
-
Remove traces of BeOS.
- a2d9a9b95ad9 18.0 landed
-
More correct way to check for existence of types, which allows to specify
- 15abc7788e66 7.2.1 cited