From 10fb48d66de76e7dc1e36ef18af502ed9600352f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 2 Jul 2015 16:40:55 -0400 Subject: Add an optional missing_ok argument to SQL function current_setting(). This allows convenient checking for existence of a GUC from SQL, which is particularly useful when dealing with custom variables. David Christensen, reviewed by Jeevan Chalke --- doc/src/sgml/func.sgml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 99923f46bca..76f77cb0fcf 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -16444,7 +16444,7 @@ SELECT collation for ('foo' COLLATE "de_DE"); current_setting - current_setting(setting_name) + current_setting(setting_name [, missing_ok ]) text get current value of setting @@ -16492,6 +16492,11 @@ SELECT current_setting('datestyle'); ISO, MDY (1 row) + + If there is no setting named setting_name, + current_setting throws an error + unless missing_ok is supplied and is + true. -- cgit v1.2.3