How to get shorter SERVER_VERSION in psql-prompt?

From: Andreas Joseph Krogh <andreas(at)visena(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: How to get shorter SERVER_VERSION in psql-prompt?
Date: 2018-09-03 20:52:31
Message-ID: VisenaEmail.45.809b268f4ddd981.165a1337341@tc7-visena
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all, I'm using the Ubuntu-packages and have this in my .psqlrc:
 
\set PROMPT1 '%[%033[35m%]%n(at)%m:%>%[%033[0m%] %:server_version:
%[%033[32m%]%/%[%033[0m%]%R%# '
 
This results in this verver_version:
10.5 (Ubuntu 10.5-1.pgdg18.04+1)
 
Is it possible to adjust this somehow so it outputs only "10.5"?
 
Thanks in advance.
 
-- Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
andreas(at)visena(dot)com <mailto:andreas(at)visena(dot)com>
www.visena.com <https://www.visena.com>
<https://www.visena.com>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2018-09-03 21:03:10 Re: How to get shorter SERVER_VERSION in psql-prompt?
Previous Message Mate Varga 2018-09-03 19:57:28 Re: very slow largeobject transfers through JDBC