pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Provide a test for variable existence in psql
2+ messages / 2 participants
[nested] [flat]

* pgsql: Provide a test for variable existence in psql
@ 2017-09-21 23:11  Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Andrew Dunstan @ 2017-09-21 23:11 UTC (permalink / raw)
  To: pgsql-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


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pgsql: Provide a test for variable existence in psql
@ 2017-09-22 05:20  Fabien COELHO <coelho@cri.ensmp.fr>
  parent: Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Fabien COELHO @ 2017-09-22 05:20 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; +Cc: pgsql-committers


> Provide a test for variable existence in psql

Thanks for the editing & commit.

Pavel's feedback helped to devise a nicer syntax, although it was not 
strictly speaking a review.

-- 
Fabien.


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2017-09-22 05:20 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-09-21 23:11 pgsql: Provide a test for variable existence in psql Andrew Dunstan <andrew@dunslane.net>
2017-09-22 05:20 ` Fabien COELHO <coelho@cri.ensmp.fr>

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