Re: show() function - updated patch - Mailing list pgsql-patches
From | Bruce Momjian |
---|---|
Subject | Re: show() function - updated patch |
Date | |
Msg-id | 200207301917.g6UJHXR11522@candle.pha.pa.us Whole thread Raw |
In response to | Re: show() function - updated patch (Joe Conway <mail@joeconway.com>) |
List | pgsql-patches |
Your patch has been added to the PostgreSQL unapplied patches list at: http://candle.pha.pa.us/cgi-bin/pgpatches I will try to apply it within the next 48 hours. --------------------------------------------------------------------------- Joe Conway wrote: > Tom Lane wrote: > > It might be good if the func.sgml part said in so many words that these > > functions are equivalent to SHOW and SET respectively; and perhaps the > > ref pages for SHOW and SET should cross-reference the functions. > > Otherwise seems fine. > > > > OK - done. Here's a new patch. > > Thanks, > > Joe [ text/html is unsupported, treating like TEXT/PLAIN ] > 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 22:16:16 -0000 > *************** > *** 4437,4442 **** > --- 4437,4557 ---- > </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> > Index: doc/src/sgml/ref/set.sgml > =================================================================== > RCS file: /opt/src/cvs/pgsql/doc/src/sgml/ref/set.sgml,v > retrieving revision 1.62 > diff -c -r1.62 set.sgml > *** doc/src/sgml/ref/set.sgml 11 Jun 2002 15:41:30 -0000 1.62 > --- doc/src/sgml/ref/set.sgml 20 Jul 2002 22:06:25 -0000 > *************** > *** 495,500 **** > --- 495,510 ---- > </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 > 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 22:06:37 -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"> > *************** > *** 102,107 **** > --- 128,143 ---- > <para> > The <command>SHOW</command> command is a > <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> > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
pgsql-patches by date: