Re: Add version macro to libpq-fe.h - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Add version macro to libpq-fe.h
Date
Msg-id 20210617183411.2taf6r32kftvfnb3@alap3.anarazel.de
Whole thread Raw
In response to Re: Add version macro to libpq-fe.h  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Add version macro to libpq-fe.h
List pgsql-hackers
Hi,

On 2021-06-17 13:16:17 -0400, Tom Lane wrote:
> > Then again, why would pg_config.h be absent?
> 
> Likely because somebody decided it was a server-side include rather
> than an application-side include.

Which is the right call - pg_config.h can't easily be included in
applications that themselves use autoconf. Most problematically it
defines all the standard autotools PACKAGE_* macros that are guaranteed
to conflict in any autotools using project. There's obviously also a lot
of other defines in there that quite possibly could conflict.

We probably split pg_config.h at some point. Even for extensions it can
be annoying because pg_config.h is always included in server code, which
means that the extension can't easily include an autoheader style header
itself.


I'm not sure I understand why you think that exposing the version number
for libpq is such a bad idea?


I think it'd be reasonable to add a few more carefully chosen macros to
pg_config_ext.h.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints
Next
From: Tom Lane
Date:
Subject: Re: Add version macro to libpq-fe.h