Here is a doc patch for the SHOW X changes and new config-settings

functions. If there are no objections, please apply.

Joe Conway
This commit is contained in:
Bruce Momjian 2002-08-04 03:53:11 +00:00
parent 22c64f1834
commit 7ef5634701
3 changed files with 166 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.105 2002/07/31 02:27:28 momjian Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.106 2002/08/04 03:53:10 momjian Exp $
PostgreSQL documentation
-->
@ -4441,6 +4441,121 @@ SELECT NULLIF(value, '(none)') ...
server's version.
</para>
<table>
<title>Configuration Settings Information Functions</title>
<tgroup cols="3">
<thead>
<row><entry>Name</entry> <entry>Return Type</entry> <entry>Description</entry></row>
</thead>
<tbody>
<row>
<entry>
<function>current_setting</function>(<parameter>setting_name</parameter>)
</entry>
<entry><type>text</type></entry>
<entry>value of current setting</entry>
</row>
<row>
<entry>
<function>set_config(<parameter>setting_name</parameter>,
<parameter>new_value</parameter>,
<parameter>is_local</parameter>)</function>
</entry>
<entry><type>text</type></entry>
<entry>new value of current setting</entry>
</row>
</tbody>
</tgroup>
</table>
<indexterm zone="functions-misc">
<primary>setting</primary>
<secondary>current</secondary>
</indexterm>
<indexterm zone="functions-misc">
<primary>setting</primary>
<secondary>set</secondary>
</indexterm>
<para>
The <function>current_setting</function> is used to obtain the current
value of the <parameter>setting_name</parameter> setting, as a query
result. It is the equivalent to the SQL <command>SHOW</command> command.
For example:
<programlisting>
select current_setting('DateStyle');
current_setting
---------------------------------------
ISO with US (NonEuropean) conventions
(1 row)
</programlisting>
</para>
<para>
<function>set_config</function> allows the <parameter>setting_name
</parameter> setting to be changed to <parameter>new_value</parameter>.
If <parameter>is_local</parameter> is set to <literal>true</literal>,
the new value will only apply to the current transaction. If you want
the new value to apply for the current session, use
<literal>false</literal> instead. It is the equivalent to the SQL
<command>SET</command> command. For example:
<programlisting>
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)
</programlisting>
</para>
<table>
<title>Access Privilege Inquiry Functions</title>
<tgroup cols="3">

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.62 2002/06/11 15:41:30 thomas Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.63 2002/08/04 03:53:11 momjian Exp $
PostgreSQL documentation
-->
@ -495,6 +495,16 @@ SELECT CURRENT_TIMESTAMP AS today;
</para>
</refsect2>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
The function <function>set_config</function> provides the equivalent
capability. See <citetitle>Miscellaneous Functions</citetitle> in the
<citetitle>PostgreSQL User's Guide</citetitle>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/show.sgml,v 1.17 2002/05/17 01:19:16 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/show.sgml,v 1.18 2002/08/04 03:53:11 momjian Exp $
PostgreSQL documentation
-->
@ -83,7 +83,10 @@ SHOW ALL
<screen>
SHOW DateStyle;
INFO: DateStyle is ISO with US (NonEuropean) conventions
DateStyle
---------------------------------------
ISO with US (NonEuropean) conventions
(1 row)
</screen>
</para>
@ -91,9 +94,32 @@ INFO: DateStyle is ISO with US (NonEuropean) conventions
Show the current genetic optimizer (<literal>geqo</literal>) setting:
<screen>
SHOW GEQO;
INFO: geqo is on
geqo
------
on
(1 row)
</screen>
</para>
<para>
Show all settings:
<screen>
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)
</screen>
</para>
</refsect1>
<refsect1 id="R1-SQL-SHOW-3">
@ -104,6 +130,16 @@ INFO: geqo is on
<productname>PostgreSQL</productname> extension.
</para>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
The function <function>current_setting</function> produces equivalent
output. See <citetitle>Miscellaneous Functions</citetitle> in the
<citetitle>PostgreSQL User's Guide</citetitle>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file