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

From Fabien COELHO
Subject Re: Variable substitution in psql backtick expansion
Date
Msg-id alpine.DEB.2.20.1704020947290.4632@lancre
Whole thread Raw
In response to Re: Variable substitution in psql backtick expansion  (Fabien COELHO <coelho@cri.ensmp.fr>)
List 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.



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: Variable substitution in psql backtick expansion
Next
From: David Rowley
Date:
Subject: Re: Performance improvement for joins where outer side is unique