pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.
Date: Tue, 5 Sep 2017 21:01:25 +0200 (CEST)
Message-ID: <alpine.DEB.2.20.1709052059210.17848@lancre> (raw)
In-Reply-To: <8505.1504635783@sss.pgh.pa.us>
References: <E1dpFCX-0004YD-E7@gemulon.postgresql.org>
	<CANP8+j+WC3zXTJrMQgfX1_TB23FmWzbiN71yWThb0N4gdvBgZQ@mail.gmail.com>
	<2774.1504628172@sss.pgh.pa.us>
	<CA+TgmoZpe2YJdFLFH6YSka5TVX4VcsmT05cEXWOHxJ2wzCBE2w@mail.gmail.com>
	<4782.1504630716@sss.pgh.pa.us>
	<CANP8+jLGoZKRA-HT2yqfg4YJiPsJ+qe0aKTpGbNsntbz-396WQ@mail.gmail.com>
	<7437.1504634344@sss.pgh.pa.us>
	<8505.1504635783@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (18+ messages)  latest in thread

Message-ID: <alpine.DEB.2.20.1709052059210.17848@lancre>
Permalink:  ../alpine.DEB.2.20.1709052059210.17848@lancre/
Also on:    postgresql.org/message-id/alpine.DEB.2.20.1709052059210.17848@lancre

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: coelho@cri.ensmp.fr, tgl@sss.pgh.pa.us, simon@2ndquadrant.com, robertmhaas@gmail.com
  Subject: Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version.
  In-Reply-To: <alpine.DEB.2.20.1709052059210.17848@lancre>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox