Re: Variable substitution in psql backtick expansion
Fabien COELHO <coelho@cri.ensmp.fr>
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>,
Pavel Stehule <pavel.stehule@gmail.com>,
Corey Huinker <corey.huinker@gmail.com>,
Daniel Verite <daniel@manitou-mail.org>,
PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2017-09-06T16:42:58Z
Lists: pgsql-hackers
Attachments
- psql-server-version-1.patch (text/x-diff) patch
>> Seeing it as is, it calls for having "SERVER_VERSION" as well, but I'm not >> sure of the better way to get it. I tried with "SELECT VERSION() AS >> SERVER_VERSION \gset" but varnames are lowerized. > > The problem there is you can't get version() without an extra round trip > to the server --- and an extra logged query --- which people are going to > complain about. Here is a PoC that does it through a guc, just like "server_version" (the short version) is transmitted, with a fallback if it is not there. Whether it is worth it is debatable, but I like the symmetry of having the same informations accessible the same way for client and server sides. -- 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