Re: Cannot find a working 64-bit integer type on Illumos

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tomas Vondra <tomas(at)vondra(dot)me>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Japin Li <japinli(at)hotmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Cannot find a working 64-bit integer type on Illumos
Date: 2025-09-04 09:01:37
Message-ID: 216b3727-fb16-4d15-9003-35ec2d1dc701@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03.09.25 17:04, Peter Eisentraut wrote:
> Consider a third-party extension that does something like dblink or
> postgres_fdw.  It will compile against a server and also a libpq.  The
> server and the libpq might not be of the same major version.  (On
> Debian, only the latest libpq will be available.)  If you have for
> example server version 17 and libpq version 18, then you will get the
> pg_int64 typedef both from postgres_ext.h (from the PG17 server
> includes) and from libpq-fe.h (from PG18 libpq).  That is not allowed in
> C99, and even if it were, the underlying types of PG_INT64_TYPE (in
> PG17) and int64_t (in PG18) might be different (long int vs. long long
> int) and this would fail.
>
> I think this could be fixed by moving the definition of pg_int64 back to
> postgres_ext.h.  Then extension builds would only get one definition,
> because of the header guards.  Depending on include order, they could
> get a different underlying type, but that's a smaller problem, since the
> type is supposed to be deprecated anyway.

Here is a patch that has been reported to fix the problem.

Attachment Content-Type Size
v0-0001-Move-pg_int64-back-to-postgres_ext.h.patch text/plain 1.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2025-09-04 09:05:03 Re: Cannot find a working 64-bit integer type on Illumos
Previous Message jian he 2025-09-04 09:00:02 Re: pg_restore --no-policies should not restore policies' comment