Re: show() function - updated patch - Mailing list pgsql-patches
| From | Joe Conway |
|---|---|
| Subject | Re: show() function - updated patch |
| Date | |
| Msg-id | 3D39D22D.3060908@joeconway.com Whole thread Raw |
| In response to | Re: show() function (Peter Eisentraut <peter_e@gmx.net>) |
| Responses |
Re: show() function - updated patch
Re: show() function - updated patch |
| List | pgsql-patches |
Tom Lane wrote:
> This patch is lacking documentation additions for the newly-defined
> functions; not to mention doc updates for the new behavior of SHOW.
> Please supply...
Here is a doc patch for the SHOW X changes and new config-settings
functions. If there are no objections, please apply.
Thanks,
Joe
Index: doc/src/sgml/ref/show.sgml
===================================================================
RCS file: /opt/src/cvs/pgsql/doc/src/sgml/ref/show.sgml,v
retrieving revision 1.17
diff -c -r1.17 show.sgml
*** doc/src/sgml/ref/show.sgml 17 May 2002 01:19:16 -0000 1.17
--- doc/src/sgml/ref/show.sgml 20 Jul 2002 16:54:21 -0000
***************
*** 83,89 ****
<screen>
SHOW DateStyle;
! INFO: DateStyle is ISO with US (NonEuropean) conventions
</screen>
</para>
--- 83,92 ----
<screen>
SHOW DateStyle;
! DateStyle
! ---------------------------------------
! ISO with US (NonEuropean) conventions
! (1 row)
</screen>
</para>
***************
*** 91,99 ****
Show the current genetic optimizer (<literal>geqo</literal>) setting:
<screen>
SHOW GEQO;
! INFO: geqo is on
</screen>
</para>
</refsect1>
<refsect1 id="R1-SQL-SHOW-3">
--- 94,125 ----
Show the current genetic optimizer (<literal>geqo</literal>) setting:
<screen>
SHOW GEQO;
! 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">
Index: doc/src/sgml/func.sgml
===================================================================
RCS file: /opt/src/cvs/pgsql/doc/src/sgml/func.sgml,v
retrieving revision 1.104
diff -c -r1.104 func.sgml
*** doc/src/sgml/func.sgml 24 Jun 2002 22:17:01 -0000 1.104
--- doc/src/sgml/func.sgml 20 Jul 2002 20:34:04 -0000
***************
*** 4437,4442 ****
--- 4437,4555 ----
</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. 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. 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>
pgsql-patches by date: