diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index e36dde81b7e..4703e04d0d5 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -1,5 +1,5 @@
@@ -4441,6 +4441,121 @@ SELECT NULLIF(value, '(none)') ...
server's version.
+
+ Configuration Settings Information Functions
+
+
+ Name Return Type Description
+
+
+
+
+
+ current_setting(setting_name)
+
+ text
+ value of current setting
+
+
+
+ set_config(setting_name,
+ new_value,
+ is_local)
+
+ text
+ new value of current setting
+
+
+
+
+
+
+ setting
+ current
+
+
+
+ setting
+ set
+
+
+
+ The current_setting is used to obtain the current
+ value of the setting_name setting, as a query
+ result. It is the equivalent to the SQL SHOW command.
+ For example:
+
+select current_setting('DateStyle');
+ current_setting
+---------------------------------------
+ ISO with US (NonEuropean) conventions
+(1 row)
+
+
+
+
+ set_config allows the setting_name
+ setting to be changed to new_value.
+ If is_local is set to true,
+ the new value will only apply to the current transaction. If you want
+ the new value to apply for the current session, use
+ false instead. It is the equivalent to the SQL
+ SET command. For example:
+
+SHOW show_query_stats;
+ show_query_stats
+------------------
+ on
+(1 row)
+
+select set_config('show_query_stats','off','f');
+ set_config
+------------
+ off
+(1 row)
+
+SHOW show_query_stats;
+ show_query_stats
+------------------
+ off
+(1 row)
+
+select set_config('show_query_stats','on','t');
+ set_config
+------------
+ on
+(1 row)
+
+SHOW show_query_stats;
+ show_query_stats
+------------------
+ off
+(1 row)
+
+BEGIN;
+BEGIN
+select set_config('show_query_stats','on','t');
+ set_config
+------------
+ on
+(1 row)
+
+SHOW show_query_stats;
+ show_query_stats
+------------------
+ on
+(1 row)
+
+COMMIT;
+COMMIT
+SHOW show_query_stats;
+ show_query_stats
+------------------
+ off
+(1 row)
+
+
+
Access Privilege Inquiry Functions
diff --git a/doc/src/sgml/ref/set.sgml b/doc/src/sgml/ref/set.sgml
index 5ccb3a7a0df..359fb85b2ec 100644
--- a/doc/src/sgml/ref/set.sgml
+++ b/doc/src/sgml/ref/set.sgml
@@ -1,5 +1,5 @@
@@ -495,6 +495,16 @@ SELECT CURRENT_TIMESTAMP AS today;
+
+
+ See Also
+
+
+ The function set_config provides the equivalent
+ capability. See Miscellaneous Functions in the
+ PostgreSQL User's Guide.
+
+
@@ -83,7 +83,10 @@ SHOW ALL
SHOW DateStyle;
-INFO: DateStyle is ISO with US (NonEuropean) conventions
+ DateStyle
+---------------------------------------
+ ISO with US (NonEuropean) conventions
+(1 row)
@@ -91,9 +94,32 @@ INFO: DateStyle is ISO with US (NonEuropean) conventions
Show the current genetic optimizer (geqo) setting:
SHOW GEQO;
-INFO: geqo is on
+ geqo
+------
+ on
+(1 row)
+
+
+ Show all settings:
+
+SHOW ALL;
+ name | setting
+-------------------------------+---------------------------------------
+ australian_timezones | off
+ authentication_timeout | 60
+ checkpoint_segments | 3
+ .
+ .
+ .
+ wal_debug | 0
+ wal_files | 0
+ wal_sync_method | fdatasync
+(94 rows)
+
+
+
@@ -104,6 +130,16 @@ INFO: geqo is on
PostgreSQL extension.
+
+
+ See Also
+
+
+ The function current_setting produces equivalent
+ output. See Miscellaneous Functions in the
+ PostgreSQL User's Guide.
+
+