For this case can be nice to have function that returns server version as

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'

Also possible but less informative on errors:

  \set ON_ERROR_STOP on
  \if false \endif


Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to