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-08-26T16:40:05Z
Lists: pgsql-hackers
Attachments
- psql-version-num-5.patch (text/x-diff) patch
Hello Tom, >> I understand that you would prefer VERSION_NAME to show something like >> "11devel, server 9.6.4" > No, that's not what I said. I'm just complaining that as the patch stands > it will set SERVER_NAME to "11.0", where I think it should say "11devel" > (as of today). Ok. > [...] > VERSION "PostgreSQL 11devel on ..." > CLIENT_VERSION_NAME "11devel" > CLIENT_VERSION_NUM 110000 This kind of inconsistencies is hard for human memory:-( > or just leaving "CLIENT" implicit for all of these variables: > > VERSION "PostgreSQL 11devel on ..." > VERSION_NAME "11devel" > VERSION_NUM 110000 That is already what the patch does, because of the VERSION precedent. > Robert seems to prefer the last of those, and that'd be fine with me. > (Note that CLIENT is ambiguous anyway: does it mean psql itself, or > libpq?) Hmmm. Indeed. >> SERVER_VERSION_NAME "9.6.4" >> SERVER_VERSION_NUM 090604 > > I'm on board with this, except I don't think we should have any leading > zero in the numeric form. There are contexts where somebody might think > that means octal. Indeed. The implementation already does this, I just typed it without checking. So basically the only thing needed from Robert & you seems to change "11.0" to "11devel", which is fine with me. The attached v5 does that. -- 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