Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.
Date: 2017-09-05 19:01:25
Message-ID: alpine.DEB.2.20.1709052059210.17848@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers


>> Huh? The variable will be set in any case. It should be correct for any
>> server version we might find in the wild --- so far as I can tell from the
>> commit history, every version supporting FE/BE protocol version 3 has sent
>> server_version at connection start. With a pre-7.4 server, it looks like
>> the variables would be set to "0.0.0" and "0" respectively.
>
> Scratch that: experimentation says it works fine with older servers too.
> The oldest one I have in captivity reports

Ok, be it means a recent psql connecting to an old server. It does not
work with an old psql.

> SERVER_VERSION_NAME = '7.0.3'
> SERVER_VERSION_NUM = '70003'
>
> Looking more closely, I see that when using protocol version 2, libpq
> will issue a "select version()" command at connection start to get
> this info.

Then it could be used for free to set SERVER_VERSION if it can be
extracted from libpq somehow?!

--
Fabien.

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-09-05 19:08:06 pgsql: Remove unnecessary parentheses in return statements
Previous Message Fabien COELHO 2017-09-05 18:58:37 Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2017-09-05 19:04:57 Re: A note about debugging TAP failures
Previous Message Fabien COELHO 2017-09-05 18:58:37 Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.