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.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers