Hello Tom,

...  I'm still not sure that there's any use case for the
string versions ("9.6.4" etc).

If somebody's doing comparisons, they probably want the numeric
version, but somebody might want to print the string version in an
error message e.g. \if <test involving VERSION_NUM> \echo this thing
doesn't work on :VERSION_NAME \quit \endif

OK, but if human-friendly display is the use-case then it ought to
duplicate what psql itself would print in, eg, the startup message about
server version mismatch.  The v4 patch does not, in particular it neglects
PQparameterStatus(pset.db, "server_version").  This would result in
printing, eg, "11.0" when the user would likely rather see "11devel".

I understand that you would prefer VERSION_NAME to show something like

  "11devel, server 9.6.4"

Instead of the current "11devel" when there is a client/server mismatch? I do not like it much. Note that the server version is already available as :SERVER_NAME/NUM.

Moreover I would like to point out that pre-existing :VERSION does not do such a thing. I was just extending it to have something more convenient and simple, hence the names.

Now they can be named :CLIENT_VERSION_NAME/NUM instead, as suggested by Robert, but that would be a little bit inconsistent with the existing VERSION...

Or maybe we could rename it CLIENT_VERSION as well, and make the ambiguous VERSION be the "11devel, server 9.6.4" thing?

In summary, my prefered option is to have:
  CLIENT_VERSION "PostgreSQL 11devel on ..."
  CLIENT_VERSION_NAME "11devel"
  CLIENT_VERSION_NUM 110000
  SERVER_VERSION_NAME "9.6.4"
  SERVER_VERSION_NUM 090604
  maybe SERVER_VERSION for the long string?
  and VERSION as "11devel server 9.6.4" is no match, or just the short
  string if match, so that it is nearly upward compatible?

As always, the committer decides.

--
Fabien.


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to