To be able to identify more easily which package a connected server is
coming from, I would like to embed the (Debian) package version in the
version() output which is coming from PG_VERSION. It is fairly easy to
do that, but it requires patching configure(.in):
$ ./configure VENDOR_VERSION="Debian 10.1-2"
# select version();
version
══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
PostgreSQL 10.1 on x86_64-pc-linux-gnu (Debian 10.1-2), compiled by gcc
(Debian 7.2.0-17) 7.2.1 20171205, 64-bit
PoC patch against HEAD attached - if the approach is deemed
acceptable, I'll also update the relevant documentation bits.
Thanks,
Christoph
diff --git a/configure b/configure
new file mode 100755
index 58eafd3..d68fecd
*** a/configure
--- b/configure
*************** fi
*** 16773,16779 ****
cat >>confdefs.h <<_ACEOF
! #define PG_VERSION_STR "PostgreSQL $PG_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"
_ACEOF
--- 16773,16779 ----
cat >>confdefs.h <<_ACEOF
! #define PG_VERSION_STR "PostgreSQL $PG_VERSION on $host${VENDOR_VERSION:+ ($VENDOR_VERSION)}, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"
_ACEOF
diff --git a/configure.in b/configure.in
new file mode 100644
index 5245899..dccf5b2
*** a/configure.in
--- b/configure.in
*************** else
*** 2185,2191 ****
fi
AC_DEFINE_UNQUOTED(PG_VERSION_STR,
! ["PostgreSQL $PG_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
[A string containing the version number, platform, and C compiler])
# Supply a numeric version string for use by 3rd party add-ons
--- 2185,2191 ----
fi
AC_DEFINE_UNQUOTED(PG_VERSION_STR,
! ["PostgreSQL $PG_VERSION on $host${VENDOR_VERSION:+ ($VENDOR_VERSION)}, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
[A string containing the version number, platform, and C compiler])
# Supply a numeric version string for use by 3rd party add-ons