Re: [HACKERS] Variable substitution in psql backtick expansion - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Variable substitution in psql backtick expansion
Date
Msg-id 14596.1503701034@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Variable substitution in psql backtick expansion  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] Variable substitution in psql backtick expansion  (Robert Haas <robertmhaas@gmail.com>)
Re: [HACKERS] Variable substitution in psql backtick expansion  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Aug 25, 2017 at 6:09 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> ...  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".
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] Variable substitution in psql backtick expansion
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] [Proposal] Allow users to specify multiple tables inVACUUM commands