summaryrefslogtreecommitdiff
path: root/src/include/fe_utils/psqlscan_int.h
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2017-09-21 19:02:23 -0400
committerAndrew Dunstan <andrew@dunslane.net>2017-09-21 19:02:23 -0400
commitd57c7a7c506276597af619bdb8c62fa5b592745a (patch)
tree6cab776216fa74f256164cbbc7859fbe1fb97b02 /src/include/fe_utils/psqlscan_int.h
parent71480501057fee9fa3649b072173ff10e2b842d0 (diff)
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
Diffstat (limited to 'src/include/fe_utils/psqlscan_int.h')
-rw-r--r--src/include/fe_utils/psqlscan_int.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/fe_utils/psqlscan_int.h b/src/include/fe_utils/psqlscan_int.h
index c70ff29f4ef..e9b351756b9 100644
--- a/src/include/fe_utils/psqlscan_int.h
+++ b/src/include/fe_utils/psqlscan_int.h
@@ -142,5 +142,7 @@ extern char *psqlscan_extract_substring(PsqlScanState state,
extern void psqlscan_escape_variable(PsqlScanState state,
const char *txt, int len,
PsqlScanQuoteType quote);
+extern void psqlscan_test_variable(PsqlScanState state,
+ const char *txt, int len);
#endif /* PSQLSCAN_INT_H */