From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: Provide a test for variable existence in psql
Date: Thu, 21 Sep 2017 23:11:44 +0000
Message-ID: <E1dvAdE-0007yW-2Z@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Provide a test for variable existence in psql
"\if :{?variable_name}" will be translated to "\if TRUE" if the variable
exists and "\if FALSE" otherwise. Thus it will be possible to execute code
conditionally on the existence of the variable, regardless of its value.
Fabien Coelho, with some review by Robins Tharakan and some light text
editing by me.
Discussion: https://postgr.es/m/alpine.DEB.2.20.1708260835520.3627@lancre
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/d57c7a7c506276597af619bdb8c62fa5b592745a
Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 10 +++++++++
src/bin/psql/psqlscanslash.l | 18 ++++++++++++++++
src/fe_utils/psqlscan.l | 42 ++++++++++++++++++++++++++++++++++++-
src/include/fe_utils/psqlscan_int.h | 2 ++
src/test/regress/expected/psql.out | 26 +++++++++++++++++++++++
src/test/regress/sql/psql.sql | 18 ++++++++++++++++
6 files changed, 115 insertions(+), 1 deletion(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: andrew@dunslane.net
Subject: Re: pgsql: Provide a test for variable existence in psql
In-Reply-To: <E1dvAdE-0007yW-2Z@gemulon.postgresql.org>
References: <E1dvAdE-0007yW-2Z@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox