Re: Variable substitution in psql backtick expansion
Fabien COELHO <coelho@cri.ensmp.fr>
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Daniel Verite <daniel@manitou-mail.org>, Tom Lane <tgl@sss.pgh.pa.us>,
PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2017-04-02T07:52:25Z
Lists: pgsql-hackers
> For this case can be nice to have function that returns server version as
> number
>
> some like version_num() .. 10000
Another possible trick to get out of a script which does not support \if,
relying on the fact that the unexpected command is simply ignored:
-- exit version below 10
\if false
\echo 'script requires version 10 or better'
\q
\endif
Also possible but less informative on errors:
\set ON_ERROR_STOP on
\if false \endif
--
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