Re: Package version in PG_VERSION and version()

From: Christoph Berg <christoph(dot)berg(at)credativ(dot)de>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Package version in PG_VERSION and version()
Date: 2017-12-15 11:53:31
Message-ID: 20171215115331.GD31812@msg.credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Re: Michael Paquier 2017-12-15 <CAB7nPqTra6ZkPr0xTmHY0J4gmKwbStbMmaKMa9Kswb2bZxe=yw(at)mail(dot)gmail(dot)com>
> On Fri, Dec 15, 2017 at 7:46 PM, Christoph Berg
> <christoph(dot)berg(at)credativ(dot)de> wrote:
> > 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):
>
> Why reinventing the wheel when there is already --with-extra-version
> that you can use for the same purpose?

That modifies the PG version number as such, as what psql is showing
on connect. I'd think that is too intrusive.

And it doesn't work anyway: $ ./configure --with-extra-version ' (Debian 10.1-2)'
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: (Debian 10.1-2)
configure: error: argument required for --with-extra-version option

> And I think that I can see a
> bug here on HEAD, src/tools/msvc/Solution.pm correctly uses
> --with-extra-version in PG_VERSION_STR but ./configure is forgetting
> it. If you want to push for this proposal anyway, I think that you
> should update the msvc scripts as well.

configure.in looks right, it includes the extra version right in
PG_VERSION:

PGAC_ARG_REQ(with, extra-version, [STRING], [append STRING to version],
[PG_VERSION="$PACKAGE_VERSION$withval"],
[PG_VERSION="$PACKAGE_VERSION"])
AC_DEFINE_UNQUOTED(PG_VERSION, "$PG_VERSION", [PostgreSQL version as a string])

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])

I'll update the msvc scripts once we figure out where my idea of
"vendor package version" is best placed.

Mit freundlichen Grüßen,
Christoph Berg
--
Senior Berater, Tel.: +49 2166 9901 187
credativ GmbH, HRB Mönchengladbach 12080, USt-ID-Nummer: DE204566209
Trompeterallee 108, 41189 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer
pgp fingerprint: 5C48 FE61 57F4 9179 5970 87C6 4C5A 6BAB 12D2 A7AE

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2017-12-15 12:01:55 Re: GSoC 2018
Previous Message Stephen Frost 2017-12-15 11:52:52 Re: GSoC 2018