Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpI9g-00057Z-67 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Sep 2017 18:00:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dpI9f-0006W8-KV for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Sep 2017 18:00:55 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dpI81-00037Y-UM for pgsql-hackers@postgresql.org; Tue, 05 Sep 2017 17:59:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dpI7v-0004r7-CI for pgsql-hackers@postgresql.org; Tue, 05 Sep 2017 17:59:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v85Hx43S007438; Tue, 5 Sep 2017 13:59:04 -0400 From: Tom Lane To: Simon Riggs cc: Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Add psql variables showing server version and psql version. In-reply-to: References: <2774.1504628172@sss.pgh.pa.us> <4782.1504630716@sss.pgh.pa.us> Comments: In-reply-to Simon Riggs message dated "Tue, 05 Sep 2017 10:41:11 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7436.1504634344.1@sss.pgh.pa.us> Date: Tue, 05 Sep 2017 13:59:04 -0400 Message-ID: <7437.1504634344@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Simon Riggs writes: > Does raise the further question of how psql behaves when we connect to > a pre-10 server, so we have SERVER_VERSION_NUM but yet it is not set. 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. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers