Re: Variable substitution in psql backtick expansion

Daniel Verite <daniel@manitou-mail.org>

From: "Daniel Verite" <daniel@manitou-mail.org>
To: "Fabien COELHO" <coelho@cri.ensmp.fr>
Cc: "Tom Lane" <tgl@sss.pgh.pa.us>,"PostgreSQL Developers" <pgsql-hackers@postgreSQL.org>
Date: 2017-04-02T13:31:02Z
Lists: pgsql-hackers
	Fabien COELHO wrote:

> Note that this is already available indirectly, as show in the 
> documentation.
> 
>   SELECT some-boolean-expression AS okay \gset
>   \if :okay
>     \echo boolean expression was true
>   \else
>     \echo boolean expression was false
>   \endif

Yes, the question was whether we leave it as that for v10,
or if it's worth a last-minute improvement for usability,
assuming it's doable, similarly to what $subject does to backtick
expansion for external evaluation.


Best regards,
-- 
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite


Commits

  1. Add psql variables showing server version and psql version.

  2. Reformat psql's --help=variables output.

  3. Remove reinvention of stringify macro.

  4. Allow psql variable substitution to occur in backtick command strings.