diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-08-04 03:53:11 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-08-04 03:53:11 +0000 |
commit | 7ef5634701c086ba62fe425bf4b6c1bd1fa68740 (patch) | |
tree | 639a2b4f6ede77079644217319685989cd342e20 /doc/src | |
parent | 22c64f18349dfba623f9c844363b484475d3c45e (diff) | |
download | postgresql-7ef5634701c086ba62fe425bf4b6c1bd1fa68740.tar.gz postgresql-7ef5634701c086ba62fe425bf4b6c1bd1fa68740.zip |
Here is a doc patch for the SHOW X changes and new config-settings
functions. If there are no objections, please apply.
Joe Conway
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 117 | ||||
-rw-r--r-- | doc/src/sgml/ref/set.sgml | 12 | ||||
-rw-r--r-- | doc/src/sgml/ref/show.sgml | 42 |
3 files changed, 166 insertions, 5 deletions
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 @@ <!-- -$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 --> @@ -4442,6 +4442,121 @@ SELECT NULLIF(value, '(none)') ... </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"> <thead> 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 @@ <!-- -$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 diff --git a/doc/src/sgml/ref/show.sgml b/doc/src/sgml/ref/show.sgml index b752f86ee61..ad5565cf053 100644 --- a/doc/src/sgml/ref/show.sgml +++ b/doc/src/sgml/ref/show.sgml @@ -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 |