Re: Variable substitution in psql backtick expansion

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Daniel Verite <daniel(at)manitou-mail(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Variable substitution in psql backtick expansion
Date: 2017-04-02 07:45:52
Message-ID: alpine.DEB.2.20.1704020917220.4632@lancre
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers


Hello Pavel,

> For this case can be nice to have function that returns server version
> as number some like version_num() .. 10000

The server side information can be queried:

SELECT current_setting(‘server_version_num’)
AS server_version_num \gset
-- 90602

However client side is not so clean:

\echo :VERSION
PostgreSQL 10devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609, 64-bit

Probably some :VERSION_NUM would make some sense. See attached PoC patch.
Would it make sense?

--
Fabien.

Attachment Content-Type Size
psql-version-num-1.patch text/x-diff 1.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2017-04-02 07:52:25 Re: Variable substitution in psql backtick expansion
Previous Message Pavel Stehule 2017-04-02 06:58:28 Re: Variable substitution in psql backtick expansion