Re: Variable substitution in psql backtick expansion
Pavel Stehule <pavel.stehule@gmail.com>
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Daniel Verite <daniel@manitou-mail.org>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2017-04-02T10:13:19Z
Lists: pgsql-hackers
2017-04-02 9:45 GMT+02:00 Fabien COELHO <coelho@cri.ensmp.fr>: > > 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? Maybe better name for you CLIENT_VERSION_NUM Can be SERVER_VERSION_NUM taken from connection info? Regards Pavel > > > -- > Fabien.
Commits
-
Add psql variables showing server version and psql version.
- a6c678f018d3 10.0 landed
- 9ae9d8c1549c 11.0 landed
-
Reformat psql's --help=variables output.
- 3955c8c4eda2 11.0 landed
-
Remove reinvention of stringify macro.
- cd6baed78150 10.0 landed
-
Allow psql variable substitution to occur in backtick command strings.
- f833c847b8fa 10.0 landed